{"id":3848,"date":"2022-12-30T14:57:56","date_gmt":"2022-12-30T06:57:56","guid":{"rendered":"https:\/\/badgameshow.com\/steven\/?p=3848"},"modified":"2022-12-30T17:37:33","modified_gmt":"2022-12-30T09:37:33","slug":"go%e8%aa%9e%e8%a8%80%e8%ae%8a%e9%87%8f%e9%a1%9e%e5%9e%8b%e7%9a%84%e6%87%89%e7%94%a8%e8%88%87%e5%84%aa%e5%8b%a2","status":"publish","type":"post","link":"https:\/\/badgameshow.com\/steven\/go\/go%e8%aa%9e%e8%a8%80%e8%ae%8a%e9%87%8f%e9%a1%9e%e5%9e%8b%e7%9a%84%e6%87%89%e7%94%a8%e8%88%87%e5%84%aa%e5%8b%a2\/","title":{"rendered":"Go\u8a9e\u8a00\u8b8a\u91cf\u985e\u578b\u7684\u61c9\u7528\u8207\u512a\u52e2"},"content":{"rendered":"<p><meta name=\"keywords\" content=\"Go, \u8b8a\u91cf\u985e\u578b, \u9ad4\u73fe\"><\/p>\n<p>Go \u8a9e\u8a00\u662f\u4e00\u7a2e\u975e\u5e38\u6d41\u884c\u7684\u7de8\u7a0b\u8a9e\u8a00\uff0c\u5b83\u7684\u8b8a\u91cf\u985e\u578b\u9ad4\u73fe\u4e86\u5b83\u7684\u5f37\u5927\u529f\u80fd\u3002Go \u8a9e\u8a00\u652f\u6301\u591a\u7a2e\u8b8a\u91cf\u985e\u578b\uff0c\u5305\u62ec\u6574\u6578\u3001\u6d6e\u9ede\u6578\u3001\u5b57\u7b26\u4e32\u3001\u5e03\u723e\u503c\u3001\u6307\u91dd\u3001\u7d50\u69cb\u3001\u63a5\u53e3\u3001\u5207\u7247\u3001\u6620\u5c04\u7b49\u3002<br \/>\n<!--more--><\/p>\n<h2>Go \u8a9e\u8a00\u7684\u6574\u6578\u8b8a\u91cf\u985e\u578b<\/h2>\n<p>Go \u8a9e\u8a00\u652f\u6301\u5169\u7a2e\u6574\u6578\u985e\u578b\uff1a\u6709\u7b26\u865f\u6574\u6578\u548c\u7121\u7b26\u865f\u6574\u6578\u3002\u6709\u7b26\u865f\u6574\u6578\u53ef\u4ee5\u8868\u793a\u6b63\u6578\u548c\u8ca0\u6578\uff0c\u800c\u7121\u7b26\u865f\u6574\u6578\u53ea\u80fd\u8868\u793a\u6b63\u6578\u3002Go \u8a9e\u8a00\u652f\u6301 8 \u4f4d\u300116 \u4f4d\u300132 \u4f4d\u548c 64 \u4f4d\u7684\u6709\u7b26\u865f\u6574\u6578\uff0c\u5206\u5225\u70ba int8\u3001int16\u3001int32 \u548c int64\uff1bGo \u8a9e\u8a00\u652f\u6301 8 \u4f4d\u300116 \u4f4d\u300132 \u4f4d\u548c 64 \u4f4d\u7684\u7121\u7b26\u865f\u6574\u6578\uff0c\u5206\u5225\u70ba uint8\u3001uint16\u3001uint32 \u548c uint64\u3002<\/p>\n<h2>Go \u8a9e\u8a00\u7684\u6d6e\u9ede\u6578\u8b8a\u91cf\u985e\u578b<\/h2>\n<p>Go \u8a9e\u8a00\u652f\u6301\u5169\u7a2e\u6d6e\u9ede\u6578\u985e\u578b\uff1afloat32 \u548c float64\u3002float32 \u7684\u7cbe\u5ea6\u70ba 7 \u4f4d\uff0cfloat64 \u7684\u7cbe\u5ea6\u70ba 15 \u4f4d\u3002<\/p>\n<h2>Go \u8a9e\u8a00\u7684\u5b57\u7b26\u4e32\u8b8a\u91cf\u985e\u578b<\/h2>\n<p>Go \u8a9e\u8a00\u7684\u5b57\u7b26\u4e32\u662f\u7531\u5b57\u7b26\u7d44\u6210\u7684\u4e00\u500b\u5b57\u7b26\u5e8f\u5217\uff0c\u5b57\u7b26\u4e32\u662f\u4e0d\u53ef\u8b8a\u7684\uff0c\u4e00\u65e6\u5275\u5efa\uff0c\u5c31\u4e0d\u80fd\u66f4\u6539\u3002Go \u8a9e\u8a00\u7684\u5b57\u7b26\u4e32\u662f\u7531 UTF-8 \u7de8\u78bc\u7684\uff0c\u53ef\u4ee5\u4f7f\u7528\u5b57\u7b26\u4e32\u51fd\u6578\u4f86\u64cd\u4f5c\u5b57\u7b26\u4e32\u3002<\/p>\n<h2>Go \u8a9e\u8a00\u7684\u5e03\u723e\u8b8a\u91cf\u985e\u578b<\/h2>\n<p>Go \u8a9e\u8a00\u7684\u5e03\u723e\u8b8a\u91cf\u985e\u578b\u53ea\u6709\u5169\u500b\u503c\uff1atrue \u548c false\u3002\u5b83\u53ef\u4ee5\u7528\u4f86\u8868\u793a\u771f\u5047\uff0c\u4e5f\u53ef\u4ee5\u7528\u4f86\u505a\u908f\u8f2f\u904b\u7b97\u3002<\/p>\n<h2>Go \u8a9e\u8a00\u7684\u6307\u91dd\u8b8a\u91cf\u985e\u578b<\/h2>\n<p>Go \u8a9e\u8a00\u7684\u6307\u91dd\u8b8a\u91cf\u985e\u578b\u53ef\u4ee5\u6307\u5411\u4efb\u4f55\u6578\u64da\u985e\u578b\uff0c\u5b83\u53ef\u4ee5\u7528\u4f86\u5b58\u5132\u6578\u64da\u7684\u5730\u5740\u3002Go \u8a9e\u8a00\u7684\u6307\u91dd\u8b8a\u91cf\u985e\u578b\u53ef\u4ee5\u4f7f\u7528 * \u904b\u7b97\u7b26\u4f86\u5b9a\u7fa9\u3002<\/p>\n<h2>Go \u8a9e\u8a00\u7684\u7d50\u69cb\u8b8a\u91cf\u985e\u578b<\/h2>\n<p>Go \u8a9e\u8a00\u7684\u7d50\u69cb\u8b8a\u91cf\u985e\u578b\u53ef\u4ee5\u7528\u4f86\u5c01\u88dd\u591a\u500b\u4e0d\u540c\u985e\u578b\u7684\u8b8a\u91cf\uff0c\u5b83\u53ef\u4ee5\u7528\u4f86\u5c01\u88dd\u4e00\u7d44\u76f8\u95dc\u7684\u6578\u64da\u3002Go \u8a9e\u8a00\u7684\u7d50\u69cb\u8b8a\u91cf\u985e\u578b\u53ef\u4ee5\u4f7f\u7528 struct \u95dc\u9375\u5b57\u4f86\u5b9a\u7fa9\u3002<\/p>\n<h2>Go \u8a9e\u8a00\u7684\u63a5\u53e3\u8b8a\u91cf\u985e\u578b<\/h2>\n<p>Go \u8a9e\u8a00\u7684\u63a5\u53e3\u8b8a\u91cf\u985e\u578b\u53ef\u4ee5\u7528\u4f86\u8868\u793a\u4e00\u7d44\u65b9\u6cd5\uff0c\u5b83\u53ef\u4ee5\u7528\u4f86\u5b9a\u7fa9\u4e00\u500b\u985e\u578b\u7684\u884c\u70ba\u3002Go \u8a9e\u8a00\u7684\u63a5\u53e3\u8b8a\u91cf\u985e\u578b\u53ef\u4ee5\u4f7f\u7528 interface \u95dc\u9375\u5b57\u4f86\u5b9a\u7fa9\u3002<\/p>\n<h2>Go \u8a9e\u8a00\u7684\u5207\u7247\u8b8a\u91cf\u985e\u578b<\/h2>\n<p>Go \u8a9e\u8a00\u7684\u5207\u7247\u8b8a\u91cf\u985e\u578b\u53ef\u4ee5\u7528\u4f86\u8868\u793a\u4e00\u500b\u53ef\u8b8a\u9577\u5ea6\u7684\u6578\u7d44\uff0c\u5b83\u53ef\u4ee5\u52a8\u614b\u7684\u589e\u52a0\u6216\u6e1b\u5c11\u5143\u7d20\u7684\u6578\u91cf\u3002Go \u8a9e\u8a00\u7684\u5207\u7247\u8b8a\u91cf\u985e\u578b\u53ef\u4ee5\u4f7f\u7528 [] \u95dc\u9375\u5b57\u4f86\u5b9a\u7fa9\u3002<\/p>\n<h2>Go \u8a9e\u8a00\u7684\u6620\u5c04\u8b8a\u91cf\u985e\u578b<\/h2>\n<p>Go \u8a9e\u8a00\u7684\u6620\u5c04\u8b8a\u91cf\u985e\u578b\u53ef\u4ee5\u7528\u4f86\u8868\u793a\u4e00\u500b\u9375\u503c\u5c0d\u7684\u96c6\u5408\uff0c\u5b83\u53ef\u4ee5\u7528\u4f86\u5b58\u5132\u4efb\u610f\u985e\u578b\u7684\u6578\u64da\u3002Go \u8a9e\u8a00\u7684\u6620\u5c04\u8b8a\u91cf\u985e\u578b\u53ef\u4ee5\u4f7f\u7528 map \u95dc\u9375\u5b57\u4f86\u5b9a\u7fa9\u3002<\/p>\n<p>Go \u8a9e\u8a00\u7684\u8b8a\u91cf\u985e\u578b\u9ad4\u73fe\u4e86\u5b83\u7684\u5f37\u5927\u529f\u80fd\uff0c\u5b83\u652f\u6301\u591a\u7a2e\u8b8a\u91cf\u985e\u578b\uff0c\u5305\u62ec\u6574\u6578\u3001\u6d6e\u9ede\u6578\u3001\u5b57\u7b26\u4e32\u3001\u5e03\u723e\u503c\u3001\u6307\u91dd\u3001\u7d50\u69cb\u3001\u63a5\u53e3\u3001\u5207\u7247\u3001\u6620\u5c04\u7b49\uff0c\u53ef\u4ee5\u6eff\u8db3\u4e0d\u540c\u7684\u7de8\u7a0b\u9700\u6c42\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Go\u8a9e\u8a00\u8b8a\u91cf\u985e\u578b\u7684\u61c9\u7528\u53ef\u4ee5\u8b93\u958b\u767c\u8005\u66f4\u52a0\u6709\u6548\u7387\u7684\u958b\u767c\u7a0b\u5f0f\uff0c\u672c\u6587\u5c07\u4ecb\u7d39Go\u8a9e\u8a00\u8b8a\u91cf\u985e\u578b\u7684\u57fa\u672c\u6982\u5ff5\u3001\u7279\u6027\u8207\u61c9\u7528\uff0c\u8b93\u958b\u767c\u8005\u66f4\u52a0\u4e86\u89e3Go\u8a9e\u8a00\u8b8a\u91cf\u985e\u578b\u7684\u512a\u52e2\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[171,172],"tags":[169,170],"class_list":["post-3848","post","type-post","status-publish","format-standard","hentry","category-go","category-golang","tag-go","tag-golang"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack-related-posts":[],"jetpack_shortlink":"https:\/\/wp.me\/pcFK27-104","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/posts\/3848","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/comments?post=3848"}],"version-history":[{"count":2,"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/posts\/3848\/revisions"}],"predecessor-version":[{"id":3929,"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/posts\/3848\/revisions\/3929"}],"wp:attachment":[{"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/media?parent=3848"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/categories?post=3848"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/tags?post=3848"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}