<\/figure>\n<\/p>\n\u3001\u533a\u5757\u94fe\u5e94\u7528\u7b49\u9886\u57df\u3002<\/p>\n
2. Go \u7a0b\u5e8f\u7ed3\u6784\uff1a<\/p>\n
Go \u8bed\u8a00\u91c7\u7528 package\uff08\u5305\uff09\u673a\u5236\u8fdb\u884c\u6a21\u5757\u5316\u7ec4\u7ec7\u3002\u4e00\u4e2a Go \u7a0b\u5e8f\u662f\u7531\u4e00\u4e2a\u6216\u591a\u4e2a\u5305\u7ec4\u6210\u7684\uff0c\u6bcf\u4e2a\u5305\u6709\u4e00\u4e2a\u6216\u591a\u4e2a\u6e90\u6587\u4ef6\u7ec4\u6210\u3002\u7a0b\u5e8f\u4e2d\u7684\u529f\u80fd\u901a\u8fc7\u51fd\u6570\u5b9e\u73b0\uff0c\u51fd\u6570\u53ef\u4ee5\u5728\u540c\u4e00\u4e2a\u5305\u6216\u4e0d\u540c\u5305\u4e4b\u95f4\u8c03\u7528\u3002<\/p>\n
3. \u53ef\u6267\u884c\u6587\u4ef6\uff1a<\/p>\n
\u53ef\u6267\u884c\u6587\u4ef6\u662f\u6307\u5728\u64cd\u4f5c\u7cfb\u7edf\u4e2d\u5305\u542b\u76f4\u63a5\u8fd0\u884c\u7684\u6307\u4ee4\u548c\u6570\u636e\u7684\u6587\u4ef6\u3002Go \u652f\u6301\u5c06\u7a0b\u5e8f\u7f16\u8bd1\u6210\u5bf9\u5e94\u5e73\u53f0\uff08\u5982 Windows\u3001macOS \u548c Linux\uff09\u7684\u53ef\u6267\u884c\u6587\u4ef6\uff0c\u8fd9\u4e2a\u6587\u4ef6\u53ef\u4ee5\u5728\u4e0d\u4f9d\u8d56\u5176\u4ed6\u5e93\u6216\u73af\u5883\u7684\u60c5\u51b5\u4e0b\u8fd0\u884c\u3002<\/p>\n
\u7b2c\u4e8c\u90e8\u5206\uff1a\u5728 Go \u8bed\u8a00\u4e2d\u5236\u4f5c\u4e00\u4e2a\u7b80\u5355\u7684 exe \u7a0b\u5e8f<\/p>\n
1. \u5f00\u53d1\u73af\u5883\u4e0e\u5de5\u5177\uff1a<\/p>\n
– \u5b89\u88c5 Go \u7f16\u8bd1\u5668\uff1a\u4e0b\u8f7d\u5e76\u5b89\u88c5 Go \u7f16\u8bd1\u5668\u4ee5\u5339\u914d\u60a8\u7684\u64cd\u4f5c\u7cfb\u7edf\u3002\u8bbf\u95ee\u5b98\u65b9\u7f51\u7ad9 (https:\/\/golang.org\/dl\/) \u4e0b\u8f7d\u5b89\u88c5\u7a0b\u5e8f\u3002<\/p>\n
– \u7f16\u8f91\u5668\u6216\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09\uff1a\u63a8\u8350\u4f7f\u7528 Visual Studio Code\u3001GoLand \u7b49 Go \u7f16\u7a0b\u652f\u6301\u7684\u7f16\u8f91\u5668\u6216 IDE\u3002<\/p>\n
2. \u7f16\u5199\u4e00\u4e2a\u7b80\u5355\u7684 Go \u7a0b\u5e8f\uff1a<\/p>\n
– \u521b\u5efa\u4e00\u4e2a\u540d\u4e3a “hello.go” \u7684\u6587\u4ef6\uff0c\u5e76\u8f93\u5165\u4ee5\u4e0b\u4ee3\u7801\uff1a<\/p>\n
“`go<\/p>\n
package main<\/p>\n<\/p>\n
import “fmt”<\/p>\n<\/p>\n
func main() {<\/p>\n
fmt.Println(“Hello, World!”)<\/p>\n
}<\/p>\n
“`<\/p>\n
\u8fd9\u662f\u4e00\u4e2a\u7b80\u5355\u7684 Go \u7a0b\u5e8f\uff0c\u5b83\u5c06\u5728\u8fd0\u884c\u65f6\u8f93\u51fa “Hello, World!”\u3002<\/p>\n
3. \u751f\u6210\u53ef\u6267\u884c\u6587\u4ef6\uff1a<\/p>\n
– \u6253\u5f00\u547d\u4ee4\u63d0\u793a\u7b26\uff08Windows\uff09\u6216\u7ec8\u7aef\uff08macOS \u548c Linux\uff09\u3002<\/p>\n
– \u5bfc\u822a\u81f3\u5305\u542b “hello.go” \u6587\u4ef6\u7684\u76ee\u5f55\uff0c\u5e76\u6267\u884c\u5982\u4e0b\u547d\u4ee4\uff1a<\/p>\n
“`<\/p>\n
go build hello.go<\/p>\n
“`<\/p>\n
\u5982\u679c\u4e00\u5207\u6b63\u5e38\uff0c\u60a8\u5c06\u770b\u5230 “hello.exe”\uff08Windows\uff09\u6216 “hello”\uff08macOS \u548c Linux\uff09\u6587\u4ef6\u751f\u6210\u5728\u540c\u4e00\u76ee\u5f55\u4e0b\u3002<\/p>\n
4. \u8fd0\u884c\u53ef\u6267\u884c\u6587\u4ef6\uff1a<\/p>\n
– \u53cc\u51fb “hello.exe”\uff08Windows\uff09\u6216\u5728\u7ec8\u7aef\u8f93\u5165 “.\/hello”\uff08macOS \u548c Linux\uff09\uff0c\u8fd9\u5c06\u663e\u793a “Hello, World!” \u4fe1\u606f\u3002<\/p>\n
\u7b2c\u4e09\u90e8\u5206\uff1a\u603b\u7ed3<\/p>\n
\u901a\u8fc7\u672c\u6559\u7a0b\uff0c\u60a8\u5b66\u4e60\u4e86 Go \u7f16\u7a0b\u539f\u7406\uff0c\u4ee5\u53ca\u5982\u4f55\u5f00\u53d1\u5e76\u751f\u6210\u4e00\u4e2a exe \u7a0b\u5e8f\u3002\u60a8\u8fd8\u53ef\u4ee5\u5728 Go \u8bed\u8a00\u4e2d\u5b9e\u73b0\u66f4\u9ad8\u7ea7\u7684\u529f\u80fd\uff0c\u5e76\u5c06\u5176\u7528\u4e8e\u5b9e\u9645\u9879\u76ee\u3002\u65e0\u8bba\u60a8\u662f\u8981\u5f00\u53d1\u6e38\u620f\u3001\u5de5\u5177\u8f6f\u4ef6\u8fd8\u662f\u5185\u90e8\u5e94\u7528\u7a0b\u5e8f\uff0cGo \u8bed\u8a00\u90fd\u80fd\u8fbe\u5230\u76ee\u7684\u3002\u73b0\u5728\u662f\u65f6\u5019\u7ee7\u7eed\u5b66\u4e60\u3001\u5b9e\u8df5\u5e76\u638c\u63e1 Go \u8bed\u8a00\u7684\u66f4\u591a\u529f\u80fd\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"
\u9898\u76ee\uff1aGo \u7f16\u7a0b\u5f00\u53d1 exe \u7a0b\u5e8f – \u539f\u7406\u4e0e\u8be6\u7ec6\u4ecb\u7ecdGo \u8bed\u8a00\uff08\u4e5f\u79f0 Golang\uff09\u662f\u4e00\u79cd\u73b0\u4ee3\u7f16\u7a0b\u8bed\u8a00\uff0c\u65e8\u5728\u7b80\u5316\u7f16\u7a0b\u4efb\u52a1\u5e76\u63d0\u9ad8\u8f6f\u4ef6\u5f00\u53d1\u901f\u5ea6\u3002\u901a\u8fc7 Go \u8bed\u8a00\uff0c\u60a8\u53ef\u4ee5\u521b\u5efa\u72ec\u7acb\u7684\u53ef\u6267\u884c\u6587\u4ef6\uff08exe \u7a0b<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[665,24,9483,34,614],"topic":[],"class_list":["post-5038","post","type-post","status-publish","format-standard","hentry","category-zhuomianruanjian","tag-html","tag-24","tag-exe","tag-34","tag-614"],"_links":{"self":[{"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/posts\/5038","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/comments?post=5038"}],"version-history":[{"count":0,"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/posts\/5038\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/media?parent=5038"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/categories?post=5038"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/tags?post=5038"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/topic?post=5038"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}