{"id":181,"date":"2019-09-01T16:48:56","date_gmt":"2019-09-01T08:48:56","guid":{"rendered":"http:\/\/blog.coolcoding.cn\/?p=181"},"modified":"2023-04-30T23:27:02","modified_gmt":"2023-04-30T15:27:02","slug":"vscode%e5%ae%89%e8%a3%85golang%e6%8f%92%e4%bb%b6","status":"publish","type":"post","link":"https:\/\/blog.coolcoding.cn\/?p=181","title":{"rendered":"VSCode\u5b89\u88c5golang\u63d2\u4ef6"},"content":{"rendered":"\n<p>:: \u7b2c\u4e00\u6b65\uff1a\u6267\u884c\u4ee5\u4e0bBAT<\/p>\n\n\n\n<p>mkdir e:\\download\\github.com\\mdempsky<br>\ncd e:\\download\\github.com\\mdempsky\/<br>\ngit clone https:\/\/github.com\/mdempsky\/gocode<\/p>\n\n\n\n<p>mkdir e:\\download\\github.com\\ramya-rao-a<br>\ncd e:\\download\\github.com\\ramya-rao-a<br>\ngit clone https:\/\/github.com\/ramya-rao-a\/go-outline<\/p>\n\n\n\n<p>mkdir e:\\download\\github.com\\acroca<br>\ncd e:\\download\\github.com\\acroca<br>\ngit clone https:\/\/github.com\/acroca\/go-symbols<\/p>\n\n\n\n<p>mkdir e:\\download\\github.com\\stamblerre<br>\ncd e:\\download\\github.com\\stamblerre<br>\ngit clone https:\/\/github.com\/stamblerre\/gocode<\/p>\n\n\n\n<p>mkdir e:\\download\\github.com\\ianthehat<br>\ncd e:\\download\\github.com\\ianthehat<br>\ngit clone https:\/\/github.com\/ianthehat\/godef<\/p>\n\n\n\n<p>mkdir e:\\download\\github.com\\sqs<br>\ncd e:\\download\\github.com\\sqs<br>\ngit clone https:\/\/github.com\/sqs\/goreturns<\/p>\n\n\n\n<p>mkdir e:\\download\\golang.org\\x<br>\ncd e:\\download\\golang.org\\x<br>\ngit clone https:\/\/github.com\/golang\/tools.git tools<br>\ngit clone https:\/\/github.com\/golang\/lint<\/p>\n\n\n\n<p>:: \u7b2c\u4e8c\u6b65\uff1a\u5c06download\u4e2d\u7684github.com\u548cgolang.org\u76ee\u5f55\u62f7\u5230 %GOPATH%\\src\u76ee\u5f55\u4e2d<\/p>\n\n\n\n<p>:: \u7b2c\u4e09\u6b65\uff1a\u5728%GOPATH%\u4e2d\u6267\u884c\u4ee5\u4e0bBAT<\/p>\n\n\n\n<p>go install github.com\/mdempsky\/gocode<br>\ngo install github.com\/ramya-rao-a\/go-outline<br>\ngo install github.com\/acroca\/go-symbols<br>\ngo install golang.org\/x\/tools\/cmd\/guru<br>\ngo install golang.org\/x\/tools\/cmd\/gorename<br>\ngo install github.com\/stamblerre\/gocode<br>\ngo install github.com\/ianthehat\/godef<br>\ngo install github.com\/sqs\/goreturns<br>\ngo install golang.org\/x\/lint\/golint<\/p>\n\n\n\n<p>::\u7b2c\u56db\u6b65\uff1a\u628abin\u62f7\u5230%GOPATH%bin\u76ee\u5f55\u4e2d<br> \u4e00\u517113\u4e2aexe\u6587\u4ef6<br> dlv.exe            go-outline.exe     go-symbols.exe     gocode-gomod.exe<br> gocode.exe     godef-gomod.exe    godef.exe          golint.exe         gopkgs.exe         gorename.exe   goreturns.exe      gotour.exe         guru.exe<\/p>\n\n\n\n<!--nextpage-->\n\n\n\n<p>\u65b9\u68481\uff1a\u5feb\u901f\u65b9\u6848<br>\u6838\u5fc3\u662f\u914d\u7f6e\u56fd\u5185\u4e0b\u8f7d\u6e90\uff0c\u6211\u4eec\u9700\u8981\u4fee\u6539\u5982\u4e0b\u4e24\u4e2ago\u7684\u73af\u5883\u914d\u7f6e, \u6253\u5f00cmd\uff0c\u8f93\u5165\uff1ago env -w GO111MODULE=on<br>go env -w GOPROXY=https:\/\/goproxy.cn<\/p>\n\n\n\n<p>\u91cd\u65b0\u6253\u5f00VSCode\uff0c\u70b9\u51fb\u53f3\u4e0b\u65b9\u7684install all\u91cd\u65b0\u5b89\u88c5\u3002\u6216\u8005\uff0c\u5728vscode\u4e2d\u4f7f\u7528Ctrl+Shift+P\uff0c\u8f93\u5165>go:install\uff0c\u4e0b\u9762\u4f1a\u81ea\u52a8\u641c\u7d22\u76f8\u5173\u547d\u4ee4\uff0c\u6211\u4eec\u9009\u62e9Go:Install\/Update Tools\u8fd9\u4e2a\u547d\u4ee4\uff0c\u9009\u4e2d\u6240\u6709\u63d2\u4ef6\uff0c\u70b9\u51fb\u786e\u5b9a\u8fdb\u884c\u5b89\u88c5\u3002<\/p>\n\n\n\n<!--nextpage-->\n\n\n\n<p>\u65b9\u68482\uff1a\u73af\u5883\u53d8\u91cf\u4e2d\u914d\u7f6e<br> Windows\u5728\u7535\u8111 -> \u7cfb\u7edf -> \u9ad8\u7ea7\u7cfb\u7edf\u8bbe\u7f6e -> \u7528\u6237\u73af\u5883\u4e2d\u5206\u522b\u65b0\u5efaGO111MODULE\u548cGOPROXY\u4e24\u4e2a\u7528\u6237\u53d8\u91cf\uff0c\u5176\u503c\u5982\u4e0b\uff1a<\/p>\n\n\n\n<p>GO111MODULE=on<br>GOPROXY=https:\/\/goproxy.cn,direct<br><\/p>\n\n\n\n<p>\u6216\u8005\u4e5f\u53ef\u4ee5\u4f7f\u7528\u963f\u91cc\u6e90\u4ee3\u7406\u5982\u4e0b\uff1a<\/p>\n\n\n\n<p>GO111MODULE=on<br>GOPROXY=https:\/\/mirrors.aliyun.com\/goproxy\/   <\/p>\n\n\n\n<p>\u914d\u7f6e\u597d\u4e4b\u540e\uff0c\u4f7f\u7528Windows + R\u8c03\u51fa\u7ec8\u7aef\uff0c\u8f93\u5165cmd\uff0c\u901a\u8fc7go env\u547d\u4ee4\u67e5\u770bgo\u7684\u73af\u5883\u53d8\u91cf\u914d\u7f6e\u662f\u5426\u8bbe\u7f6e\u6210\u529f\u3002 <\/p>\n\n\n\n<!--nextpage-->\n\n\n\n<p>\u65b9\u68483\uff1a\u914d\u7f6evscode\u7684\u4ee3\u7801<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"781\" height=\"350\" src=\"http:\/\/blog.coolcoding.cn\/wp-content\/uploads\/2023\/04\/image.png\" alt=\"\" class=\"wp-image-4832\" srcset=\"https:\/\/blog.coolcoding.cn\/wp-content\/uploads\/2023\/04\/image.png 781w, https:\/\/blog.coolcoding.cn\/wp-content\/uploads\/2023\/04\/image-300x134.png 300w, https:\/\/blog.coolcoding.cn\/wp-content\/uploads\/2023\/04\/image-768x344.png 768w, https:\/\/blog.coolcoding.cn\/wp-content\/uploads\/2023\/04\/image-70x31.png 70w\" sizes=\"(max-width: 781px) 100vw, 781px\" \/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>:: \u7b2c\u4e00\u6b65\uff1a\u6267\u884c\u4ee5\u4e0bBAT mkdir e:\\download\\github.com\\mdempsky cd [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[14],"tags":[],"_links":{"self":[{"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=\/wp\/v2\/posts\/181"}],"collection":[{"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=181"}],"version-history":[{"count":3,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=\/wp\/v2\/posts\/181\/revisions"}],"predecessor-version":[{"id":4833,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=\/wp\/v2\/posts\/181\/revisions\/4833"}],"wp:attachment":[{"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=181"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=181"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=181"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}