{"id":207036,"date":"2025-07-08T08:41:28","date_gmt":"2025-07-08T00:41:28","guid":{"rendered":"https:\/\/server.hk\/cnblog\/207036\/"},"modified":"2025-07-08T08:41:28","modified_gmt":"2025-07-08T00:41:28","slug":"golang%e6%9e%84%e5%bb%ba%e6%89%be%e4%b8%8d%e5%88%b0%e8%b7%af%e5%be%84_-mnt-c-xxxxx%e7%9a%84%e6%a8%a1%e5%9d%97","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/207036\/","title":{"rendered":"Golang\u6784\u5efa\u627e\u4e0d\u5230\u8def\u5f84_\/mnt\/c\/XXXXX\u7684\u6a21\u5757"},"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>Golang\u6784\u5efa\u627e\u4e0d\u5230\u8def\u5f84_\/mnt\/c\/XXXXX\u7684\u6a21\u5757<\/span><\/p>\n<p><span>\u6765\u6e90\uff1astackoverflow<\/span><br \/>\n<span>2024-04-19 16:48:32<\/span><br \/>\n<span><i><\/i>0\u6d4f\u89c8<\/span><br \/>\n<span style=\"cursor: pointer\"><i><\/i>\u6536\u85cf<\/span> <\/p>\n<p>\u672c\u7bc7\u6587\u7ae0\u5411\u5927\u5bb6\u4ecb\u7ecd\u300aGolang\u6784\u5efa\u627e\u4e0d\u5230\u8def\u5f84_\/mnt\/c\/XXXXX\u7684\u6a21\u5757\u300b\uff0c\u4e3b\u8981\u5305\u62ec\uff0c\u5177\u6709\u4e00\u5b9a\u7684\u53c2\u8003\u4ef7\u503c\uff0c\u9700\u8981\u7684\u670b\u53cb\u53ef\u4ee5\u53c2\u8003\u4e00\u4e0b\u3002<\/p>\n<p> \u95ee\u9898\u5185\u5bb9<br \/>\n <\/p>\n<p>\u6211\u7684\u7cfb\u7edf\u662f windows 10 \u4e2d\u7684 wsl 2\u3002<\/p>\n<pre> os: debian 10 buster\n kernel: x86_64 linux 4.19.104-microsoft-standard\n shell: zsh 5.7.1\n cpu: amd ryzen 9 4900hs with radeon graphics @ 16x 2.994ghz\n<\/pre>\n<p>golang \u4fe1\u606f\uff1a<\/p>\n<pre>go version go1.15.2 linux\/amd64\ngoroot=\"\/usr\/local\/go\"\ngopath=\"\/mnt\/c\/workspace\/6.824\"\n<\/pre>\n<p>\u6211\u5728\u901a\u8fc7\u63d2\u4ef6\u6a21\u578b\u6784\u5efa\u9879\u76ee\u65f6\u9047\u5230\u4e86\u4e00\u4e2a\u95ee\u9898\uff1a<\/p>\n<pre>$ go build -buildmode=plugin ..\/mrapps\/wc.go\nbuild command-line-arguments: cannot find module for path _\/mnt\/c\/workspace\/6.824\/src\/mr\n<\/pre>\n<p>\u5947\u602a\u7684\u662f\u201c_\/mnt\u201d<\/p>\n<p>\u5982\u4f55\u89e3\u51b3\uff1f \u4e3a\u4ec0\u4e48\u8def\u5f84\u524d\u9762\u6709\u4e00\u4e2a\u201c_\u201d\uff1f<\/p>\n<p>\u8bf7\u5e2e\u52a9\u6211\u3002<\/p>\n<p> <\/p>\n<h2>\u89e3\u51b3\u65b9\u6848<\/h2>\n<p> <\/p>\n<p>\u6211\u4f1a\u5c1d\u8bd5\u4f7f\u7528 \u800c\u4e0d\u662f\u4f9d\u8d56 <code>gopath<\/code><\/p>\n<pre>unset GOPATH\ncd \/mnt\/c\/workspace\/6.824\/\ngo mod init \"yourProject\"\ngo build -buildmode=plugin mrapps\/wc.go<\/pre>\n<p>\u4eca\u5929\u5173\u4e8e\u300aGolang\u6784\u5efa\u627e\u4e0d\u5230\u8def\u5f84_\/mnt\/c\/XXXXX\u7684\u6a21\u5757\u300b\u7684\u5185\u5bb9\u5c31\u4ecb\u7ecd\u5230\u8fd9\u91cc\u4e86\uff0c\u662f\u4e0d\u662f\u5b66\u8d77\u6765\u4e00\u76ee\u4e86\u7136\uff01\u60f3\u8981\u4e86\u89e3\u66f4\u591a\u5173\u4e8e\u7684\u5185\u5bb9\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-207036","post","type-post","status-publish","format-standard","hentry","category-4925"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/207036","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=207036"}],"version-history":[{"count":0,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/207036\/revisions"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=207036"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=207036"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=207036"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}