How to make VS Code Go extension to work in your cloud folder on different platforms?
I started to play with Go aka Golang. Yeah, leaving the comfort zone, all that buzz. And for quite some time I've been engaged with VS Code whenever/wherever I did dev activities.
VS Code has a solid Go support via its official extension:
Info
This extension adds rich language support for the Go language to VS Code, including:
- Completion Lists (using gocode)
- Signature Help (using gogetdoc or godef+godoc)
- Quick Info (using gogetdoc or godef+godoc)
- Goto Definition (using gogetdoc or godef+godoc)
- Find References (using guru)
- File outline (using go-outline)
- Workspace symbol search (using go-symbols)
- Rename (using gorename)
- Build-on-save (using go build and go test)
- Lint-on-save (using golint or gometalinter)
- Format (using goreturns or goimports or gofmt)
- Generate unit tests skeleton (using gotests)
- Add Imports (using gopkgs)
- Add/Remove Tags on struct fields (using gomodifytags)
- Semantic/Syntactic error reporting as you type (using gotype-live)
Mark that gotools in the brackets, these ones are powering all that extra functionality and got installed into your GOPATH
once you install them via VS Code.
And here you might face an issue if you want to use Go + VS Code both on Mac and Linux using the Dropbox folder (or any other syncing service). The issue is that binaries for Mac and Linux will overwrite themselves once you decide to install the extension on your second platform. Indeed, by default VS Code will fetch the source code of the tools and build them, placing binaries in the $GOPATH/bin
.