{"id":42728,"date":"2024-12-01T11:48:40","date_gmt":"2024-12-01T03:48:40","guid":{"rendered":"https:\/\/fwq.ai\/blog\/42728\/"},"modified":"2024-12-01T11:48:40","modified_gmt":"2024-12-01T03:48:40","slug":"%e5%8f%af%e8%a7%86%e5%8c%96%e4%bb%a3%e7%a0%81go%e6%8f%92%e4%bb%b6%e5%a6%82%e4%bd%95%e7%9c%81%e7%95%a5gopath","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/42728\/","title":{"rendered":"\u53ef\u89c6\u5316\u4ee3\u7801GO\u63d2\u4ef6\u5982\u4f55\u7701\u7565GOPATH"},"content":{"rendered":"<p><b><\/b> <\/p>\n<p>\u5f53\u524d\u4f4d\u7f6e\uff1a <span>&gt;<\/span>  <span>&gt;<\/span>  <span>&gt;<\/span>  <span>&gt;<\/span> <span>\u53ef\u89c6\u5316\u4ee3\u7801GO\u63d2\u4ef6\u5982\u4f55\u7701\u7565GOPATH<\/span><\/p>\n<h1>\u53ef\u89c6\u5316\u4ee3\u7801GO\u63d2\u4ef6\u5982\u4f55\u7701\u7565GOPATH<\/h1>\n<p><span>\u6765\u6e90\uff1astackoverflow<\/span><br \/>\n<span>2024-04-25 17:30:36<\/span><br \/>\n<span><i><\/i>0\u6d4f\u89c8<\/span><br \/>\n<span style=\"cursor: pointer\"><i><\/i>\u6536\u85cf<\/span> <\/p>\n<p>Golang\u5c0f\u767d\u4e00\u679a\uff0c\u6b63\u5728\u4e0d\u65ad\u5b66\u4e60\u79ef\u7d2f\u77e5\u8bc6\uff0c\u73b0\u5c06\u5b66\u4e60\u5230\u7684\u77e5\u8bc6\u8bb0\u5f55\u4e00\u4e0b\uff0c\u4e5f\u662f\u5c06\u6211\u7684\u6240\u5f97\u5206\u4eab\u7ed9\u5927\u5bb6\uff01\u800c\u4eca\u5929\u8fd9\u7bc7\u6587\u7ae0\u300a\u53ef\u89c6\u5316\u4ee3\u7801GO\u63d2\u4ef6\u5982\u4f55\u7701\u7565GOPATH\u300b\u5e26\u5927\u5bb6\u6765\u4e86\u89e3\u4e00\u4e0b##content_title##\uff0c\u5e0c\u671b\u5bf9\u5927\u5bb6\u7684\u77e5\u8bc6\u79ef\u7d2f\u6709\u6240\u5e2e\u52a9\uff0c\u4ece\u800c\u5f25\u8865\u81ea\u5df1\u7684\u4e0d\u8db3\uff0c\u52a9\u529b\u5b9e\u6218\u5f00\u53d1\uff01<\/p>\n<p><\/p>\n<p> \u95ee\u9898\u5185\u5bb9<br \/>\n <\/p>\n<p>\u6211\u6b63\u5728\u4f7f\u7528\u53ef\u89c6\u5316\u4ee3\u7801\u548c go \u63d2\u4ef6\u3002<\/p>\n<p>\u6211\u4e3a go test <code>\"go.testflags\" \u914d\u7f6e\u4e86\u8be6\u7ec6\u9009\u9879\uff1a[\"-v\"]<\/code>\u3002<\/p>\n<p>\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u5f53\u6211\u8fd0\u884c\u6d4b\u8bd5\u5355\u5143\u65f6\uff0c\u6211\u4ece\u8f93\u51fa\u7a97\u53e3\u4e2d\u770b\u5230\u6d4b\u8bd5\u5355\u5143\u7684\u5b8c\u6574\u8def\u5f84\u3002<\/p>\n<pre>--- PASS: TestConstantBinary (0.00s)\n    \/Users\/ian.w\/Documents\/learngo\/src\/learnGO\/tests\/constant_test.go:27: true false false<\/pre>\n<p>\u662f\u5426\u53ef\u4ee5\u4ece\u4e0a\u9762\u7701\u7565 gopath\uff0c<\/p>\n<p><code>gopath=\/users\/ian.w\/documents\/learngo<\/code><\/p>\n<p>\u975e\u5e38\u611f\u8c22\u3002<\/p>\n<p> <\/p>\n<h2>\u89e3\u51b3\u65b9\u6848<\/h2>\n<p> <\/p>\n<p>\u65e0\u6cd5\u4ece\u8f93\u51fa\u4e2d\u5220\u9664 GOPATH\u3002\u6d4b\u8bd5\u8f93\u51fa\u5c06\u59cb\u7ec8\u4f7f\u7528 <code>absolute<\/code> \u8def\u5f84<\/p>\n<p>\u5230\u8fd9\u91cc\uff0c\u6211\u4eec\u4e5f\u5c31\u8bb2\u5b8c\u4e86\u300a\u53ef\u89c6\u5316\u4ee3\u7801GO\u63d2\u4ef6\u5982\u4f55\u7701\u7565GOPATH\u300b\u7684\u5185\u5bb9\u4e86\u3002\u4e2a\u4eba\u8ba4\u4e3a\uff0c\u57fa\u7840\u77e5\u8bc6\u7684\u5b66\u4e60\u548c\u5de9\u56fa\uff0c\u662f\u4e3a\u4e86\u66f4\u597d\u7684\u5c06\u5176\u8fd0\u7528\u5230\u9879\u76ee\u4e2d\uff0c\u6b22\u8fce\u5173\u6ce8\u7c73\u4e91\u516c\u4f17\u53f7\uff0c\u5e26\u4f60\u4e86\u89e3\u66f4\u591a\u5173\u4e8e\u7684\u77e5\u8bc6\u70b9\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5f53\u524d\u4f4d\u7f6e\uff1a &gt; &gt; &gt; &gt; \u53ef\u89c6\u5316\u4ee3\u7801GO\u63d2\u4ef6\u5982\u4f55\u7701\u7565GOPATH \u53ef\u89c6\u5316\u4ee3\u7801GO\u63d2\u4ef6\u5982\u4f55\u7701\u7565GOPATH \u6765\u6e90\uff1astackoverflow 2024-04-25 17:30:36 0\u6d4f\u89c8 \u6536\u85cf Golang\u5c0f\u767d\u4e00\u679a\uff0c\u6b63\u5728\u4e0d\u65ad\u5b66\u4e60\u79ef\u7d2f\u77e5\u8bc6\uff0c\u73b0\u5c06\u5b66\u4e60\u5230\u7684\u77e5\u8bc6\u8bb0\u5f55\u4e00\u4e0b\uff0c\u4e5f\u662f\u5c06\u6211\u7684\u6240\u5f97\u5206\u4eab\u7ed9\u5927\u5bb6\uff01\u800c\u4eca\u5929\u8fd9\u7bc7\u6587\u7ae0\u300a\u53ef\u89c6\u5316\u4ee3\u7801GO\u63d2\u4ef6\u5982\u4f55\u7701\u7565GOPATH\u300b\u5e26\u5927\u5bb6\u6765\u4e86\u89e3\u4e00\u4e0b##content_title##\uff0c\u5e0c\u671b\u5bf9\u5927\u5bb6\u7684\u77e5\u8bc6\u79ef\u7d2f\u6709\u6240\u5e2e\u52a9\uff0c\u4ece\u800c\u5f25\u8865\u81ea\u5df1\u7684\u4e0d\u8db3\uff0c\u52a9\u529b\u5b9e\u6218\u5f00\u53d1\uff01 \u95ee\u9898\u5185\u5bb9 \u6211\u6b63\u5728\u4f7f\u7528\u53ef\u89c6\u5316\u4ee3\u7801\u548c go \u63d2\u4ef6\u3002 \u6211\u4e3a go test &#8220;go.testflags&#8221; \u914d\u7f6e\u4e86\u8be6\u7ec6\u9009\u9879\uff1a[&#8220;-v&#8221;]\u3002 \u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u5f53\u6211\u8fd0\u884c\u6d4b\u8bd5\u5355\u5143\u65f6\uff0c\u6211\u4ece\u8f93\u51fa\u7a97\u53e3\u4e2d\u770b\u5230\u6d4b\u8bd5\u5355\u5143\u7684\u5b8c\u6574\u8def\u5f84\u3002 &#8212; PASS: TestConstantBinary (0.00s) \/Users\/ian.w\/Documents\/learngo\/src\/learnGO\/tests\/constant_test.go:27: true false false \u662f\u5426\u53ef\u4ee5\u4ece\u4e0a\u9762\u7701\u7565 gopath\uff0c gopath=\/users\/ian.w\/documents\/learngo \u975e\u5e38\u611f\u8c22\u3002 \u89e3\u51b3\u65b9\u6848 \u65e0\u6cd5\u4ece\u8f93\u51fa\u4e2d\u5220\u9664 GOPATH\u3002\u6d4b\u8bd5\u8f93\u51fa\u5c06\u59cb\u7ec8\u4f7f\u7528 absolute \u8def\u5f84 \u5230\u8fd9\u91cc\uff0c\u6211\u4eec\u4e5f\u5c31\u8bb2\u5b8c\u4e86\u300a\u53ef\u89c6\u5316\u4ee3\u7801GO\u63d2\u4ef6\u5982\u4f55\u7701\u7565GOPATH\u300b\u7684\u5185\u5bb9\u4e86\u3002\u4e2a\u4eba\u8ba4\u4e3a\uff0c\u57fa\u7840\u77e5\u8bc6\u7684\u5b66\u4e60\u548c\u5de9\u56fa\uff0c\u662f\u4e3a\u4e86\u66f4\u597d\u7684\u5c06\u5176\u8fd0\u7528\u5230\u9879\u76ee\u4e2d\uff0c\u6b22\u8fce\u5173\u6ce8\u7c73\u4e91\u516c\u4f17\u53f7\uff0c\u5e26\u4f60\u4e86\u89e3\u66f4\u591a\u5173\u4e8e\u7684\u77e5\u8bc6\u70b9\uff01<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17],"tags":[],"class_list":["post-42728","post","type-post","status-publish","format-standard","hentry","category-docker"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/42728","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=42728"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/42728\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=42728"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=42728"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=42728"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}