{"id":3712,"date":"2022-12-30T13:44:56","date_gmt":"2022-12-30T05:44:56","guid":{"rendered":"https:\/\/badgameshow.com\/steven\/?p=3712"},"modified":"2022-12-30T13:44:56","modified_gmt":"2022-12-30T05:44:56","slug":"%e6%b7%b1%e5%85%a5%e6%8e%a2%e7%b4%a2go%e8%aa%9e%e8%a8%80%e4%b8%ad%e7%9a%84%e5%8f%8d%e5%b0%84%e6%a9%9f%e5%88%b6","status":"publish","type":"post","link":"https:\/\/badgameshow.com\/steven\/go\/%e6%b7%b1%e5%85%a5%e6%8e%a2%e7%b4%a2go%e8%aa%9e%e8%a8%80%e4%b8%ad%e7%9a%84%e5%8f%8d%e5%b0%84%e6%a9%9f%e5%88%b6\/","title":{"rendered":"\u6df1\u5165\u63a2\u7d22Go\u8a9e\u8a00\u4e2d\u7684\u53cd\u5c04\u6a5f\u5236"},"content":{"rendered":"<p><meta name=\"keywords\" content=\"Go, \u53cd\u5c04\"><\/p>\n<h1>Go \u8a9e\u8a00\u7684\u53cd\u5c04<\/h1>\n<p>Go \u8a9e\u8a00\u662f\u4e00\u7a2e\u975c\u614b\u578b\u5225\u7684\u7a0b\u5f0f\u8a9e\u8a00\uff0c\u5b83\u652f\u63f4\u53cd\u5c04\uff08Reflection\uff09\uff0c\u53cd\u5c04\u53ef\u4ee5\u8b93\u7a0b\u5f0f\u5728\u57f7\u884c\u6642\u671f\u52d5\u614b\u7684\u6aa2\u67e5\u548c\u4fee\u6539\u81ea\u8eab\u7684\u7d50\u69cb\uff0c\u53cd\u5c04\u662f\u4e00\u7a2e\u5f37\u5927\u7684\u529f\u80fd\uff0c\u53ef\u4ee5\u8b93\u7a0b\u5f0f\u66f4\u52a0\u9748\u6d3b\uff0c\u4e5f\u53ef\u4ee5\u8b93\u7a0b\u5f0f\u66f4\u52a0\u5bb9\u6613\u7dad\u8b77\u3002<\/p>\n<p><!--more--><\/p>\n<p>Go \u8a9e\u8a00\u7684\u53cd\u5c04\u529f\u80fd\u53ef\u4ee5\u8b93\u7a0b\u5f0f\u5728\u57f7\u884c\u6642\u671f\u52d5\u614b\u7684\u6aa2\u67e5\u548c\u4fee\u6539\u81ea\u8eab\u7684\u7d50\u69cb\uff0c\u53ef\u4ee5\u8b93\u7a0b\u5f0f\u66f4\u52a0\u9748\u6d3b\uff0c\u4e5f\u53ef\u4ee5\u8b93\u7a0b\u5f0f\u66f4\u52a0\u5bb9\u6613\u7dad\u8b77\u3002\u53cd\u5c04\u53ef\u4ee5\u8b93\u7a0b\u5f0f\u5728\u57f7\u884c\u6642\u671f\u52d5\u614b\u7684\u6aa2\u67e5\u548c\u4fee\u6539\u81ea\u8eab\u7684\u7d50\u69cb\uff0c\u53ef\u4ee5\u8b93\u7a0b\u5f0f\u66f4\u52a0\u9748\u6d3b\uff0c\u4e5f\u53ef\u4ee5\u8b93\u7a0b\u5f0f\u66f4\u52a0\u5bb9\u6613\u7dad\u8b77\u3002<\/p>\n<h2>Go \u8a9e\u8a00\u7684\u53cd\u5c04\u529f\u80fd<\/h2>\n<p>Go \u8a9e\u8a00\u7684\u53cd\u5c04\u529f\u80fd\u53ef\u4ee5\u8b93\u7a0b\u5f0f\u5728\u57f7\u884c\u6642\u671f\u52d5\u614b\u7684\u6aa2\u67e5\u548c\u4fee\u6539\u81ea\u8eab\u7684\u7d50\u69cb\uff0c\u53ef\u4ee5\u8b93\u7a0b\u5f0f\u66f4\u52a0\u9748\u6d3b\uff0c\u4e5f\u53ef\u4ee5\u8b93\u7a0b\u5f0f\u66f4\u52a0\u5bb9\u6613\u7dad\u8b77\u3002Go \u8a9e\u8a00\u7684\u53cd\u5c04\u529f\u80fd\u53ef\u4ee5\u8b93\u7a0b\u5f0f\u5728\u57f7\u884c\u6642\u671f\u52d5\u614b\u7684\u6aa2\u67e5\u548c\u4fee\u6539\u81ea\u8eab\u7684\u7d50\u69cb\uff0c\u53ef\u4ee5\u8b93\u7a0b\u5f0f\u66f4\u52a0\u9748\u6d3b\uff0c\u4e5f\u53ef\u4ee5\u8b93\u7a0b\u5f0f\u66f4\u52a0\u5bb9\u6613\u7dad\u8b77\u3002<\/p>\n<p>Go \u8a9e\u8a00\u7684\u53cd\u5c04\u529f\u80fd\u53ef\u4ee5\u8b93\u7a0b\u5f0f\u5728\u57f7\u884c\u6642\u671f\u52d5\u614b\u7684\u6aa2\u67e5\u548c\u4fee\u6539\u81ea\u8eab\u7684\u7d50\u69cb\uff0c\u53ef\u4ee5\u8b93\u7a0b\u5f0f\u66f4\u52a0\u9748\u6d3b\uff0c\u4e5f\u53ef\u4ee5\u8b93\u7a0b\u5f0f\u66f4\u52a0\u5bb9\u6613\u7dad\u8b77\u3002\u53cd\u5c04\u53ef\u4ee5\u8b93\u7a0b\u5f0f\u5728\u57f7\u884c\u6642\u671f\u52d5\u614b\u7684\u6aa2\u67e5\u548c\u4fee\u6539\u81ea\u8eab\u7684\u7d50\u69cb\uff0c\u53ef\u4ee5\u8b93\u7a0b\u5f0f\u66f4\u52a0\u9748\u6d3b\uff0c\u4e5f\u53ef\u4ee5\u8b93\u7a0b\u5f0f\u66f4\u52a0\u5bb9\u6613\u7dad\u8b77\u3002<\/p>\n<h2>Go \u8a9e\u8a00\u7684\u53cd\u5c04\u7bc4\u4f8b<\/h2>\n<p>\u4e0b\u9762\u662f\u4e00\u500b\u7c21\u55ae\u7684 Go \u8a9e\u8a00\u53cd\u5c04\u7bc4\u4f8b\uff0c\u53ef\u4ee5\u770b\u5230\u53cd\u5c04\u53ef\u4ee5\u8b93\u7a0b\u5f0f\u5728\u57f7\u884c\u6642\u671f\u52d5\u614b\u7684\u6aa2\u67e5\u548c\u4fee\u6539\u81ea\u8eab\u7684\u7d50\u69cb\uff1a<\/p>\n<pre class=\"brush: go\">\npackage main\n\nimport (\n    \"fmt\"\n    \"reflect\"\n)\n\nfunc main() {\n    var x float64 = 3.4\n    fmt.Println(\"type:\", reflect.TypeOf(x))\n    v := reflect.ValueOf(x)\n    fmt.Println(\"value:\", v)\n    fmt.Println(\"type:\", v.Type())\n    fmt.Println(\"kind:\", v.Kind())\n    fmt.Println(\"value:\", v.Float())\n    fmt.Println(v.Interface())\n    fmt.Printf(\"value is %5.2e\\n\", v.Interface())\n    y := v.Interface().(float64)\n    fmt.Println(y)\n}\n<\/pre>\n<p>\u57f7\u884c\u7d50\u679c\uff1a<\/p>\n<pre>\ntype: float64\nvalue: 3.4\ntype: float64\nkind: float64\nvalue: 3.4\n3.4\nvalue is 3.40e+00\n3.4\n<\/pre>\n<h2>\u7d50\u8ad6<\/h2>\n<p>\u53ef\u4ee5\u770b\u5230\uff0cGo \u8a9e\u8a00\u7684\u53cd\u5c04\u529f\u80fd\u53ef\u4ee5\u8b93\u7a0b\u5f0f\u5728\u57f7\u884c\u6642\u671f\u52d5\u614b\u7684\u6aa2\u67e5\u548c\u4fee\u6539\u81ea\u8eab\u7684\u7d50\u69cb\uff0c\u53ef\u4ee5\u8b93\u7a0b\u5f0f\u66f4\u52a0\u9748\u6d3b\uff0c\u4e5f\u53ef\u4ee5\u8b93\u7a0b\u5f0f\u66f4\u52a0\u5bb9\u6613\u7dad\u8b77\u3002\u53cd\u5c04\u662f\u4e00\u7a2e\u5f37\u5927\u7684\u529f\u80fd\uff0c\u53ef\u4ee5\u8b93\u7a0b\u5f0f\u66f4\u52a0\u9748\u6d3b\uff0c\u4e5f\u53ef\u4ee5\u8b93\u7a0b\u5f0f\u66f4\u52a0\u5bb9\u6613\u7dad\u8b77\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u672c\u6587\u5c07\u6df1\u5165\u63a2\u8a0eGo\u8a9e\u8a00\u4e2d\u7684\u53cd\u5c04\u6a5f\u5236\uff0c\u8a73\u7d30\u4ecb\u7d39\u53cd\u5c04\u7684\u6982\u5ff5\u3001\u53cd\u5c04\u7684\u57fa\u672c\u64cd\u4f5c\u3001\u53cd\u5c04\u7684\u61c9\u7528\u7b49\uff0c\u8b93\u8b80\u8005\u66f4\u52a0\u4e86\u89e3Go\u8a9e\u8a00\u4e2d\u7684\u53cd\u5c04\u6a5f\u5236\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-3712","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-XS","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/posts\/3712","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=3712"}],"version-history":[{"count":1,"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/posts\/3712\/revisions"}],"predecessor-version":[{"id":3713,"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/posts\/3712\/revisions\/3713"}],"wp:attachment":[{"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/media?parent=3712"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/categories?post=3712"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/tags?post=3712"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}