I wonder if someone can share their best setup for Golang using Vscode on Mac. As I am continously having issues such as:
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:
    {
        "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
    }
you can try this setting.
    "go.inferGopath": false,
    "go.buildOnSave": "workspace",
    "go.lintOnSave": "package",
    "go.vetOnSave": "package",
    "go.buildTags": "",
    "go.buildFlags": [],
    "go.lintFlags": [],
    "go.vetFlags": [],
    "go.coverOnSave": false,
    "go.useCodeSnippetsOnFunctionSuggest": false,
    "go.formatTool": "goreturns",
    "go.gocodeAutoBuild": false,
    "go.useLanguageServer": true,
    "go.alternateTools": {
      "go-langserver": "gopls", 
    },
    "go.languageServerExperimentalFeatures": {
      "format": true,
      "autoComplete": true
    },
    "[go]": {
        "editor.codeActionsOnSave": {
            "source.organizeImports": true
        },
    },
                        If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With