microsoft / vscode-go

An extension for VS Code which provides support for the Go language. We have moved to https://github.com/golang/vscode-go
Other
5.93k stars 648 forks source link

Command GO: Add Import is not working #3173

Closed wanfintara closed 4 years ago

wanfintara commented 4 years ago

When running GO: Add Import command, always got this message

image

Tried googling for solutions, but still cant fix it.

Go version: go1.14.2 darwin/amd64 VS Code version : 1.44.0

hyangah commented 4 years ago

@wanfintara thanks for the report. Please provide additional info about your setting.

wanfintara commented 4 years ago

@hyangah @stamblerre

all go settings

"go.gopath": "/Users/wanfintara/Documents/go",
    "go.docsTool": "gogetdoc",
    "go.lintTool":"golangci-lint",
    "go.lintFlags": [
        "--config=${workspaceFolder}/.golangci.yml",
        "--fast"
    ],

    "go.useLanguageServer": true,
    "go.languageServerExperimentalFeatures": {
        "diagnostics": true, // for build and vet errors as you type
        // "documentLink": true,
        // "format": true
    },

    // "go.coverOnSave": true,
    // "go.coverOnSingleTest": true,
    // "go.autocompleteUnimportedPackages": true,

    "go.coverageDecorator": {
        "type": "gutter",
        "coveredHighlightColor": "rgba(64,128,128,0.5)",
        "uncoveredHighlightColor": "rgba(128,64,64,0.25)",
        "coveredGutterStyle": "blockgreen",
        "uncoveredGutterStyle": "blockred"
    },
    "go.lintOnSave": "off",

    "[go]": {
        "editor.snippetSuggestions": "none",
        "editor.formatOnSave": true,
        "editor.codeActionsOnSave": {
            "source.organizeImports": true
        },
    },
    "gopls": {
        "usePlaceholders": true, // add parameter placeholders when completing a function
        // "completionDocumentation": true // for documentation in completion items
        "completeUnimported": true,
        "staticcheck": false
    }
gopkgs -format '{{.Name}};{{.ImportPath}}'
stat /Users/wanfintara/Documents/go/src/github.com/gravitational/teleport/docs/latest: too many levels of symbolic links

View: Toggle Output has nothing

wanfintara commented 4 years ago

go env

〤 go env                                    
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/wanfintara/Library/Caches/go-build"
GOENV="/Users/wanfintara/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/wanfintara/Documents/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/Cellar/go/1.14.2_1/libexec"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.14.2_1/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="/usr/local/Homebrew/Library/Homebrew/shims/mac/super/pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/ct/p1ppm59x6b79r2g19w5r7fn80000gn/T/go-build823860923=/tmp/go-build -gno-record-gcc-switches -fno-common"
hyangah commented 4 years ago

This is an issue of github.com/gravitational/teleport. They have a misconfigured symbolic link for docs/latest. It's point to itself and causes the stat command (and probably many others) to fail.

Please file an issue at https://github.com/gravitational/teleport/issues.

And, if this file is for documentation only, delete or fix the symbolic link locally (/Users/wanfintara/Documents/go/src/github.com/gravitational/teleport/docs/latest) while waiting for the fix in the upstream.

wanfintara commented 4 years ago

Will do, thanks alot.

wanfintara commented 4 years ago

Filed an issue here

stamblerre commented 4 years ago

Thanks for following up! I'll close this issue since it's an upstream bug.