winform\u6253\u5305\u5de5\u5177<\/a>\u4f7f\u7528\u7684\u662fWindows\u7cfb\u7edf\uff0c\u5219\u4f1a\u5f97\u5230\u4e00\u4e2a\u540d\u4e3a `main.exe` \u7684\u6587\u4ef6\u3002\u5728\u5176\u4ed6\u64cd\u4f5c\u7cfb\u7edf\u4e0a\uff0c\u751f\u6210\u7684\u6587\u4ef6\u540d\u5c06\u662f `main`\u3002<\/p>\n\u4e3a\u4e86\u751f\u6210\u7279\u5b9a\u64cd\u4f5c\u7cfb\u7edf\u53ca\u4f53\u7cfb\u7ed3\u6784\u7684EXE\u6587\u4ef6\uff08\u4f8b\u5982\uff0c\u5728macOS\u6216Linux\u4e0a\u4e3aWindows\u751f\u6210EXE\u6587\u4ef6\uff09\uff0c\u53ef\u4ee5\u901a\u8fc7\u8bbe\u7f6e `GOOS` \u548c `GOARCH` \u73af\u5883\u53d8\u91cf\u6765\u5b9e\u73b0\u8de8\u7f16\u8bd1\u3002\u4e0b\u9762\u662f\u4e3aWindows\u751f\u6210EXE\u6587\u4ef6\u7684\u793a\u4f8b\uff1a<\/p>\n
“`bash<\/p>\n
env GOOS=windows GOARCH=amd64 go build -o main_windows.exe main.go<\/p>\n
“`<\/p>\n
\u8fd9\u5c06\u5728\u5f53\u524d\u6587\u4ef6\u5939\u751f\u6210\u4e00\u4e2a\u540d\u4e3a `main_windows.exe` \u7684EXE\u6587\u4ef6\uff0c\u8be5\u6587\u4ef6\u53ef\u4ee5\u5728<\/p>\n
<\/figure>\n<\/p>\n64\u4f4dWindows\u64cd\u4f5c\u7cfb\u7edf\u4e0a\u8fd0\u884c\u3002<\/p>\n
\u603b\u7ed3<\/p>\n
\u73b0\u5728\uff0c\u60a8\u5df2\u7ecf\u5b66\u4f1a\u4e86\u5982\u4f55\u4f7f\u7528Go\u8bed\u8a00\u751f\u6210EXE\u6587\u4ef6\u3002\u60a8\u53ef\u4ee5\u5c06\u8fd9\u4e2a\u7b80\u5355\u7684\u7a0b\u5e8f\u6269\u5c55\u4e3a\u66f4\u590d\u6742\u7684\u5e94\u7528\u7a0b\u5e8f\uff0c\u5e76\u8f7b\u677e\u5730\u751f\u6210\u76f8\u5e94\u7684\u53ef\u6267\u884c\u6587\u4ef6\u3002\u65e0\u8bba\u60a8\u9700\u8981\u7f16\u5199\u65b0\u7a0b\u5e8f\uff0c\u8fd8\u662f\u53ea\u662f\u60f3\u4e3a\u73b0\u6709\u7684Go\u4ee3\u7801\u751f\u6210EXE\u6587\u4ef6\uff0c\u8fd9\u7bc7\u6559\u7a0b\u90fd\u80fd\u591f\u5e2e\u52a9\u60a8\u5feb\u901f\u5165\u95e8\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"
Go\u8bed\u8a00\u751f\u6210EXE\u6587\u4ef6\uff08\u539f\u7406\u53ca\u8be6\u7ec6\u4ecb\u7ecd\uff09Go\u8bed\u8a00\uff08\u4e5f\u79f0Golang\uff09\u662f\u4e00\u79cd\u5f00\u6e90\u7684\u7f16\u7a0b\u8bed\u8a00\uff0c\u7531Google\u7684Robert Griesemer\u3001Rob Pike\u548cKen Thompson\u5171\u540c\u5f00\u53d1\u3002Go\u8bed<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[8793,8792,12,34,614],"topic":[],"class_list":["post-4610","post","type-post","status-publish","format-standard","hentry","category-zhuomianruanjian","tag-luaexe","tag-macexe","tag-12","tag-34","tag-614"],"_links":{"self":[{"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/posts\/4610","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\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/comments?post=4610"}],"version-history":[{"count":0,"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/posts\/4610\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/media?parent=4610"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/categories?post=4610"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/tags?post=4610"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/topic?post=4610"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}