{"id":207574,"date":"2025-07-08T10:52:42","date_gmt":"2025-07-08T02:52:42","guid":{"rendered":"https:\/\/server.hk\/cnblog\/207574\/"},"modified":"2025-07-08T10:52:42","modified_gmt":"2025-07-08T02:52:42","slug":"windows-%e4%b8%8a%e7%9a%84-goland-%e6%97%a0%e6%b3%95%e8%af%86%e5%88%ab%e5%af%bc%e5%85%a5%e5%b9%b6%e6%8a%9b%e5%87%ba%e9%94%99%e8%af%af","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/207574\/","title":{"rendered":"Windows \u4e0a\u7684 goland \u65e0\u6cd5\u8bc6\u522b\u5bfc\u5165\u5e76\u629b\u51fa\u9519\u8bef"},"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>Windows \u4e0a\u7684 goland \u65e0\u6cd5\u8bc6\u522b\u5bfc\u5165\u5e76\u629b\u51fa\u9519\u8bef<\/span><\/p>\n<p><span>\u6765\u6e90\uff1astackoverflow<\/span><br \/>\n<span>2024-04-23 18:39:37<\/span><br \/>\n<span><i><\/i>0\u6d4f\u89c8<\/span><br \/>\n<span style=\"cursor: pointer\"><i><\/i>\u6536\u85cf<\/span> <\/p>\n<p>\u6765\u5230\u7684\u5927\u5bb6\uff0c\u76f8\u4fe1\u90fd\u662f\u7f16\u7a0b\u5b66\u4e60\u7231\u597d\u8005\uff0c\u5e0c\u671b\u5728\u8fd9\u91cc\u5b66\u4e60Golang\u76f8\u5173\u7f16\u7a0b\u77e5\u8bc6\u3002\u4e0b\u9762\u672c\u7bc7\u6587\u7ae0\u5c31\u6765\u5e26\u5927\u5bb6\u804a\u804a\u300aWindows \u4e0a\u7684 goland \u65e0\u6cd5\u8bc6\u522b\u5bfc\u5165\u5e76\u629b\u51fa\u9519\u8bef\u300b\uff0c\u4ecb\u7ecd\u4e00\u4e0b\uff0c\u5e0c\u671b\u5bf9\u5927\u5bb6\u7684\u77e5\u8bc6\u79ef\u7d2f\u6709\u6240\u5e2e\u52a9\uff0c\u52a9\u529b\u5b9e\u6218\u5f00\u53d1\uff01<\/p>\n<p> \u95ee\u9898\u5185\u5bb9<br \/>\n <\/p>\n<p>\u6211\u5df2\u7ecf\u6839\u636e\u6b64\u6587\u6863\u542f\u7528\u4e86 go \u6a21\u5757\u96c6\u6210\u3002 https:\/\/www.jetbrains.com\/help\/go\/create-a-project-with-go-modules-integration.html#enable-go-modules-in-a-project \u4f46\u6b63\u5982\u60a8\u5728\u4e0b\u56fe\u4e2d\u770b\u5230\u7684\u90a3\u6837\u3002 goland \u4e0d\u65ad\u5728\u6211\u7684\u4e00\u4e9b\u4ee3\u7801\u4e0a\u629b\u51fa\u9519\u8bef <\/p>\n<p>\u6b63\u5982\u4f60\u5728\u56fe\u7247\u4e2d\u770b\u5230\u7684\uff0c\u6211\u6709\u90a3\u4e2a execlise \u5305\uff0c\u4f46\u5b83\u4e00\u76f4\u7ed9\u51fa\u9519\u8bef\u3002\u4e0d\u4ec5\u662f\u6211\u5728\u5176\u4ed6\u6587\u4ef6\u4e0a\u6709\u4e00\u4e9b\u9519\u8bef <\/p>\n<p> <\/p>\n<h2>\u6b63\u786e\u7b54\u6848<\/h2>\n<p> <\/p>\n<p>IDE \u6709\u65f6\u4f1a\u53d1\u751f\u8fd9\u79cd\u60c5\u51b5\uff0c\u6839\u636e\u6211\u7684\u7ecf\u9a8c\uff0c\u53d1\u751f\u8fd9\u79cd\u60c5\u51b5\u7684\u539f\u56e0\u81f3\u5c11\u6709\u4e09\u4e2a\u3002<\/p>\n<p><strong>\u7b2c\u4e00\uff1a<\/strong>\u4f60\u7684go.sum\u4e2d\u7684\u8f6f\u4ef6\u5305\u7248\u672c\u4e4b\u95f4\u7684\u5dee\u5f02\uff0c\u4f60\u5e94\u8be5\u6e05\u7a7ago.sum\u5e76\u8fd0\u884c<code>go mod tidy\u547d\u4ee4<\/code>\u3002<\/p>\n<p><strong>\u7b2c\u4e8c\uff1a<\/strong>\u60a8\u4f7f\u7528\u7684\u7248\u672c\u6bd4\u60a8\u671f\u671b\u7684\u7248\u672c\u65e7\u6216\u65b0\uff0c\u56e0\u6b64\u8be5\u8f6f\u4ef6\u5305\u4e0d\u652f\u6301\u8fd9\u4e9b\u65b9\u6cd5\u6216\u4e0d\u5305\u542b\u5b83\u4eec\u3002\u6240\u4ee5\u4f60\u5e94\u8be5\u8bbe\u7f6e\u5305\u7684\u786e\u5207\u7248\u672c\u3002 \uff08\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u6211\u5efa\u8bae\u60a8\u9605\u8bfb\u8be5\u5305\u7684\u6587\u6863\uff09<\/p>\n<p><strong>\u7b2c\u4e09\uff1a<\/strong>\u60a8\u7684 IDE \u7f13\u5b58\u5b58\u5728\u4e00\u4e9b\u95ee\u9898\u3002\u8981\u89e3\u51b3\u6b64\u95ee\u9898\uff1a\u60a8\u5e94\u8be5\u5355\u51fb <code>file -&gt; invalidate caches<\/code> \u6765\u91cd\u5efa\u60a8\u7684 IDE \u7f13\u5b58\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u300aWindows \u4e0a\u7684 goland \u65e0\u6cd5\u8bc6\u522b\u5bfc\u5165\u5e76\u629b\u51fa\u9519\u8bef\u300b\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u5173\u4e8e\u7684\u8d44\u6599\u8bf7\u5173\u6ce8\u516c\u4f17\u53f7\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5f53\u524d\u4f4d\u7f6e\uff1a &gt; &gt; &#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4925],"tags":[],"class_list":["post-207574","post","type-post","status-publish","format-standard","hentry","category-4925"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/207574","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=207574"}],"version-history":[{"count":0,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/207574\/revisions"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=207574"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=207574"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=207574"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}