-
Notifications
You must be signed in to change notification settings - Fork 845
Description
Please direct general questions to:
Please review the documentation before filing an issue.
Helpful pages include:
- GOPATH
- Module Support
- Debugging
- Set "trace": "log" and share the resulting logs in the debug console when logging an issue.
Please answer these questions before submitting your issue. Thanks!
What version of Go, VS Code & VS Code Go extension are you using?
- Run
go versionto get version of Go- go1.15 version
- Run
code -vorcode-insiders -vto get version of VS Code or VS Code Insiders- 1.48.0
- Check your installed extensions to get the version of the VS Code Go extension
- 0.16.1
- Run
go envto get the go development environment details- set GO111MODULE=
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\celestino\AppData\Local\go-build
set GOENV=C:\Users\celestino\AppData\Roaming\go\env
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GOMODCACHE=C:\Users\Desktop\go-workspaces\pkg\mod
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=C:\Users\Desktop\go-workspaces
set GOPRIVATE=
set GOPROXY=https://proxy.golang.org,direct
set GOROOT=c:\go
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLDIR=c:\go\pkg\tool\windows_amd64
set GCCGO=gccgo
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=C:\Users\CELEST~1\AppData\Local\Temp\go-build843547906=/tmp/go-build -gno-record-gcc-switches
- set GO111MODULE=
Share the Go related settings you have added/edited
Run Preferences: Open Settings (JSON) command to open your settings.json file.
Share all the settings with the go. or ["go"] or gopls prefixes.
go.addTags": {
"tags": "json",
"options": "json=omitempty",
"promptForTags": false,
"transform": "snakecase"
},
// Alternate tools or alternate paths for the same tools used by the Go extension. Provide either absolute path or the name of the binary in GOPATH/bin, GOROOT/bin or PATH. Useful when you want to use wrapper script for the Go tools or versioned tools from https://gopkg.in.
"go.alternateTools": {},
// Include unimported packages in auto-complete suggestions.
"go.autocompleteUnimportedPackages": false,
// Flags to `go build`/`go test` used during build-on-save or running tests. (e.g. ["-ldflags='-s'"])
"go.buildFlags": [],
// Compiles code on file save using 'go build -i' or 'go test -c -i'. Options are 'workspace', 'package', or 'off'.
"go.buildOnSave": "package",
// The Go build tags to use for all commands, that support a `-tags '...'` argument. When running tests, go.testTags will be used instead if it was set.
"go.buildTags": "",
// This option lets you choose the way to display code coverage. Choose either to highlight the complete line or to show a decorator in the gutter. You can customize the color for the former and the style for the latter.
"go.coverageDecorator": {
"type": "highlight",
"coveredHighlightColor": "rgba(64,128,128,0.5)",
"uncoveredHighlightColor": "rgba(128,64,64,0.25)",
"coveredGutterStyle": "blockblue",
"uncoveredGutterStyle": "slashyellow"
},
// Use these options to control whether only covered or only uncovered code or both should be highlighted after running test coverage
"go.coverageOptions": "showBothCoveredAndUncoveredCode",
// If true, runs 'go test -coverprofile' on save and shows test coverage.
"go.coverOnSave": false,
// If true, shows test coverage when Go: Test Function at cursor command is run.
"go.coverOnSingleTest": false,
// If true, shows test coverage when Go: Test Single File command is run.
"go.coverOnSingleTestFile": false,
// If true, shows test coverage when Go: Test Package command is run.
"go.coverOnTestPackage": true,
// Delve settings that applies to all debugging sessions. Debug configuration in the launch.json file will override these values.
"go.delveConfig": {
"dlvLoadConfig": {
"followPointers": true,
"maxVariableRecurse": 1,
"maxStringLen": 64,
"maxArrayValues": 64,
"maxStructFields": -1
},
"apiVersion": 2,
"showGlobalVariables": true
},
// Pick 'godoc' or 'gogetdoc' to get documentation. Not applicable when using the language server.
"go.docsTool": "godoc",
// Experimental Feature: Enable/Disable entries from the context menu in the editor.
"go.editorContextMenuCommands": {
"toggleTestFile": true,
"addTags": true,
"removeTags": false,
"testAtCursor": true,
"testFile": false,
"testPackage": false,
"generateTestForFunction": true,
"generateTestForFile": false,
"generateTestForPackage": false,
"addImport": true,
"testCoverage": true,
"playground": true,
"debugTestAtCursor": true
},
// Feature level setting to enable/disable code lens for references and run/debug tests
"go.enableCodeLens": {
"references": false,
"runtest": true
},
// Flags to pass to format tool (e.g. ["-s"])
"go.formatFlags": [],
// Pick 'gofmt', 'goimports', 'goreturns' or 'goformat' to run on format. Not applicable when using the language server. Choosing 'goimports' or 'goreturns' will add missing imports and remove unused imports.
"go.formatTool": "goreturns",
// Additional command line flags to pass to `gotests` for generating tests.
"go.generateTestsFlags": [],
// Enable gocode's autobuild feature. Not applicable when using the language server.
"go.gocodeAutoBuild": false,
// Additional flags to pass to gocode. Not applicable when using the language server.
"go.gocodeFlags": [
"-builtin",
"-ignore-case",
"-unimported-packages"
],
// Used to determine the Go package lookup rules for completions by gocode. Only applies when using nsf/gocode. Latest versions of the Go extension uses mdempsky/gocode by default. Not applicable when using the language server.
"go.gocodePackageLookupMode": "go",
// Specify GOPATH here to override the one that is set as environment variable. The inferred GOPATH from workspace root overrides this, if go.inferGopath is set to true.
"go.gopath": null,
// Specifies the GOROOT to use when no environment variable is set.
"go.goroot": null,
// Folder names (not paths) to ignore while using Go to Symbol in Workspace feature
"go.gotoSymbol.ignoreFolders": [],
// If false, the standard library located at $GOROOT will be excluded while using the Go to Symbol in File feature
"go.gotoSymbol.includeGoroot": false,
// If false, the import statements will be excluded while using the Go to Symbol in File feature
"go.gotoSymbol.includeImports": false,
// Infer GOPATH from the workspace root.
"go.inferGopath": false,
// If true, then `-i` flag will be passed to `go build` everytime the code is compiled.
"go.installDependenciesWhenBuilding": true,
// Use this setting to enable/disable experimental features from the language server.
"go.languageServerExperimentalFeatures": {
"diagnostics": true,
"documentLink": true
},
// Flags like -rpc.trace and -logfile to be used while running the language server.
"go.languageServerFlags": [],
// Flags to pass to Lint tool (e.g. ["-min_confidence=.8"])
"go.lintFlags": [],
// Lints code on file save using the configured Lint tool. Options are 'file', 'package', 'workspace' or 'off'.
"go.lintOnSave": "package",
// Specifies Lint tool name.
"go.lintTool": "golint",
// Use gotype on the file currently being edited and report any semantic or syntactic errors found after configured delay.
"go.liveErrors": {
"enabled": false,
"delay": 500
},
//
"go.playground": {
"openbrowser": true,
"share": true,
"run": true
},
// Tags and options configured here will be used by the Remove Tags command to remove tags to struct fields. If promptForTags is true, then user will be prompted for tags and options. By default, all tags and options will be removed.
"go.removeTags": {
"tags": "",
"options": "",
"promptForTags": false
},
// Absolute path to a file containing environment variables definitions. File contents should be of the form key=value.
"go.testEnvFile": null,
// Environment variables that will passed to the process that runs the Go tests
"go.testEnvVars": {},
// Flags to pass to `go test`. If null, then buildFlags will be used.
"go.testFlags": null,
// Run 'go test' on save for current package. It is not advised to set this to `true` when you have Auto Save enabled.
"go.testOnSave": false,
// The Go build tags to use for when running tests. If null, then buildTags will be used.
"go.testTags": null,
// Specifies the timeout for go test in ParseDuration format.
"go.testTimeout": "30s",
// Environment variables that will passed to the processes that run the Go tools (e.g. CGO_CFLAGS)
"go.toolsEnvVars": {},
// Location to install the Go tools that the extension depends on if you don't want them in your GOPATH.
"go.toolsGopath": "",
// Trace the communication between VS Code and the Go language server.
"go.trace.server": "off",
// Complete functions with their parameter signature, including the variable types
"go.useCodeSnippetsOnFunctionSuggest": false,
// Complete functions with their parameter signature, excluding the variable types
"go.useCodeSnippetsOnFunctionSuggestWithoutType": false,
// When enabled, the extension automatically checks the Go proxy if there are updates available for the Go tools (at present, only gopls) it depends on and prompts the user accordingly
"go.useGoProxyToCheckForToolUpdates": true,
// Use the Go language server "gopls" from Google for powering language features like code navigation, completion, formatting & diagnostics.
"go.useLanguageServer": false,
// Flags to pass to `go tool vet` (e.g. ["-all", "-shadow"])
"go.vetFlags": [],
// Vets code on file save using 'go tool vet'. Options are 'workspace', 'package or 'off'.
"go.vetOnSave": "package",
}
Describe the bug
A clear and concise description of what the bug.
A clear and concise description of what you expected to happen.
After installing the go extension, I clicked on the Analysis Tools Missing tab on the bottom-right side. Even so, the go Tools did not get installed, it shows that they failed. Here is the message from the command interpreter:
Steps to reproduce the behavior:
- Go to 'VS Code Extensions and search golang.go Id extension .'
- Click on 'install Go extension, installation successful. Analysis Tools Missing. Click on it(bottom right)'
- See error github.com/xxxxx/xxxx installation FAILED
Screenshots or recordings
If applicable, add screenshots or recordings to help explain your problem.
Tools environment: GOPATH=C:\Users\Desktop\go-workspaces
Installing 7 tools at C:\Users\Desktop\go-workspaces\bin in module mode.
gocode
gopkgs
go-outline
gocode-gomod
godef
goimports
golint
Installing github.com/mdempsky/gocode FAILED
Installing github.com/uudashr/gopkgs/v2/cmd/gopkgs FAILED
Installing github.com/ramya-rao-a/go-outline FAILED
Installing github.com/stamblerre/gocode FAILED
Installing github.com/rogpeppe/godef FAILED
Installing golang.org/x/tools/cmd/goimports FAILED
Installing golang.org/x/lint/golint FAILED
7 tools failed to install.
gocode: failed to install [object Object]: Error: Command failed: C:\Go\bin\go.exe get -v github.com/mdempsky/gocode
go: downloading github.com/mdempsky/gocode v0.0.0-20200405233807-4acdcbdea79d
go get github.com/mdempsky/gocode: mkdir C:\Users\Desktop: Access is denied.
undefined
gopkgs: failed to install [object Object]: Error: Command failed: C:\Go\bin\go.exe get -v github.com/uudashr/gopkgs/v2/cmd/gopkgs
go: downloading github.com/uudashr/gopkgs v1.3.2
go: writing stat cache: mkdir C:\Users\Desktop: Access is denied.
go: downloading github.com/uudashr/gopkgs/v2 v2.1.2
go get github.com/uudashr/gopkgs/v2/cmd/gopkgs: mkdir C:\Users\Desktop: Access is denied.
undefined
go-outline: failed to install [object Object]: Error: Command failed: C:\Go\bin\go.exe get -v github.com/ramya-rao-a/go-outline
go: downloading github.com/ramya-rao-a/go-outline v0.0.0-20200117021646-2a048b4510eb
go get github.com/ramya-rao-a/go-outline: mkdir C:\Users\Desktop: Access is denied.
undefined
gocode-gomod: failed to install [object Object]: Error: Command failed: C:\Go\bin\go.exe get -v -d github.com/stamblerre/gocode
go: writing stat cache: mkdir C:\Users\Desktop: Access is denied.
go: downloading github.com/stamblerre/gocode v1.0.0
go get github.com/stamblerre/gocode: mkdir C:\Users\Desktop: Access is denied.
undefined
godef: failed to install [object Object]: Error: Command failed: C:\Go\bin\go.exe get -v github.com/rogpeppe/godef
go: writing stat cache: mkdir C:\Users\Desktop: Access is denied.
go: downloading github.com/rogpeppe/godef v1.1.2
go get github.com/rogpeppe/godef: mkdir C:\Users\Desktop: Access is denied.
undefined
goimports: failed to install [object Object]: Error: Command failed: C:\Go\bin\go.exe get -v golang.org/x/tools/cmd/goimports
go: downloading golang.org/x/tools v0.0.0-20200818005847-188abfa75333
go get golang.org/x/tools/cmd/goimports: mkdir C:\Users\Desktop: Access is denied.
undefined
golint: failed to install [object Object]: Error: Command failed: C:\Go\bin\go.exe get -v golang.org/x/lint/golint
go: downloading golang.org/x/lint v0.0.0-20200302205851-738671d3881b
go get golang.org/x/lint/golint: mkdir C:\Users\Desktop: Access is denied.
undefined