I wonder if someone can share their best setup for Golang using Vscode on Mac. As I am continously having issues such as:
- sometimes gomft doesn't work.
- Functions defined in the same package shows with a red underline warning saying it's not defined (but works when running it)
- having the following message popped up
Your workspace is misconfigured: command-line-arguments has no metadata. Please see https://github.com/golang/tools/blob/master/gopls/doc/troubleshooting.md for more information or file an issue (https://github.com/golang/go/issues/new) if you believe this is a mistake.
Here are some information of my go setup:
- Version: go1.13.4 darwin/amd64
- Settings in 'settings.json':
{
"window.zoomLevel": 1,
"workbench.iconTheme": "material-icon-theme",
"editor.accessibilitySupport": "off",
"go.useLanguageServer": true,
"go.formatTool": "gofmt",
"go.lintTool": "golangci-lint",
"[go]": {
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.organizeImports": true
},
},
"explorer.confirmDragAndDrop": false,
"javascript.updateImportsOnFileMove.enabled": "always",
"diffEditor.ignoreTrimWhitespace": false
}
- GOPATH is pointing to the folder where Go is installed