Skip to content

goimports missing from Install/Update Tools #3677

Closed
@rittneje

Description

@rittneje

What version of Go, VS Code & VS Code Go extension are you using?

Version Information
  • Run go version to get version of Go from the VS Code integrated terminal.
go version go1.23.6 darwin/arm64
  • Run gopls -v version to get version of Gopls from the VS Code integrated terminal.
Build info
----------
golang.org/x/tools/gopls v0.17.1
    golang.org/x/tools/[email protected] h1:Mt/DSfnnSe3dyf6MH/dZZ0iww+viHNhAFc4rEYDiOAw=
    github.com/BurntSushi/[email protected] h1:pxW6RcqyfI9/kWtOwnv/G+AzdKuy2ZrqINhenH4HyNs=
    github.com/google/[email protected] h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
    golang.org/x/exp/[email protected] h1:1P7xPZEwZMoBoz0Yze5Nx2/4pxj6nw9ZqHWXqP0iRgQ=
    golang.org/x/[email protected] h1:D4nJWe9zXqHOmWqj4VMOJhvzj7bEZg4wEYa759z1pH4=
    golang.org/x/[email protected] h1:fEo0HyrW1GIgZdpbhCRO0PkJajUS5H9IFUztCgEo2jQ=
    golang.org/x/[email protected] h1:TCDqnvbBsFapViksHcHySl/sW4+rTGNIAoJJesHRuMM=
    golang.org/x/[email protected] h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug=
    golang.org/x/[email protected] h1:kgwdasJRsdDWYgWcEgMF424DiXwwXHSb3V8xVTi//i8=
    golang.org/x/[email protected] h1:SP0mPeg2PmGCu03V+61EcQiOjmpri2XijexKdzv8Z1I=
    honnef.co/go/[email protected] h1:4bH5o3b5ZULQ4UrBmP+63W9r7qIkqJClEA9ko5YKx+I=
    mvdan.cc/[email protected] h1:bg91ttqXmi9y2xawvkuMXyvAA/1ZGJqYAEGjXuP0JXU=
    mvdan.cc/xurls/[email protected] h1:lyBNOm8Wo71UknhUs4QTFUNNMyxy2JEIaKKo0RWOh+8=
go: go1.23.6
  • Run code -v or code-insiders -v to get version of VS Code or VS Code Insiders.
1.96.4
cd4ee3b1c348a13bafd8f9ad8060705f6d4b9cba
arm64
  • Check your installed extensions to get the version of the VS Code Go extension
0.44.0
  • Run Ctrl+Shift+P (Cmd+Shift+P on Mac OS) > Go: Locate Configured Go Tools command.
# Tools Configuration


## Environment

GOBIN: undefined
toolsGopath: /Users/rittneje/gotools
gopath: /Users/rittneje/go-workspace
GOROOT: /usr/local/go
PATH: /opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Applications/Wireshark.app/Contents/MacOS:/usr/local/go/bin

## Tools

	go:	/usr/local/go/bin/go: go version go1.23.6 darwin/arm64

	gopls:	/Users/rittneje/gotools/bin/gopls	(version: v0.17.1 built with go: go1.23.6)
	gotests:	/Users/rittneje/gotools/bin/gotests	(version: v1.6.0 built with go: go1.23.6)
	gomodifytags:	/Users/rittneje/gotools/bin/gomodifytags	(version: v1.17.0 built with go: go1.23.6)
	impl:	/Users/rittneje/gotools/bin/impl	(version: v1.4.0 built with go: go1.23.6)
	goplay:	/Users/rittneje/gotools/bin/goplay	(version: v1.0.0 built with go: go1.23.6)
	dlv:	/Users/rittneje/gotools/bin/dlv	(version: v1.24.0 built with go: go1.23.6)
	golangci-lint:	/Users/rittneje/gotools/bin/golangci-lint	(version: v1.63.4 built with go: go1.23.6)

## Go env

Workspace Folder (go-workspace): /Users/rittneje/go-workspace

	GO111MODULE=''
	GOARCH='arm64'
	GOBIN=''
	GOCACHE='/Users/rittneje/Library/Caches/go-build'
	GOENV='/Users/rittneje/Library/Application Support/go/env'
	GOEXE=''
	GOEXPERIMENT=''
	GOFLAGS=''
	GOHOSTARCH='arm64'
	GOHOSTOS='darwin'
	GOINSECURE=''
	GOMODCACHE='/Users/rittneje/go-workspace/pkg/mod'
	GONOPROXY=''
	GONOSUMDB=''
	GOOS='darwin'
	GOPATH='/Users/rittneje/go-workspace'
	GOPRIVATE=''
	GOPROXY='https://proxy.golang.org,direct'
	GOROOT='/usr/local/go'
	GOSUMDB='sum.golang.org'
	GOTMPDIR=''
	GOTOOLCHAIN='local'
	GOTOOLDIR='/usr/local/go/pkg/tool/darwin_arm64'
	GOVCS=''
	GOVERSION='go1.23.6'
	GODEBUG=''
	GOTELEMETRY='off'
	GOTELEMETRYDIR='/Users/rittneje/Library/Application Support/go/telemetry'
	GCCGO='gccgo'
	GOARM64='v8.0'
	AR='ar'
	CC='clang'
	CXX='clang++'
	CGO_ENABLED='1'
	GOMOD='/dev/null'
	GOWORK='/Users/rittneje/go-workspace/go.work'
	CGO_CFLAGS='-O2 -g'
	CGO_CPPFLAGS=''
	CGO_CXXFLAGS='-O2 -g'
	CGO_FFLAGS='-O2 -g'
	CGO_LDFLAGS='-O2 -g'
	PKG_CONFIG='pkg-config'
	GOGCCFLAGS='-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -ffile-prefix-map=/var/folders/4r/75blkk01543_51vp0jcgy1kr0000gn/T/go-build3781262283=/tmp/go-build -gno-record-gcc-switches -fno-common'

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.toolsGopath": "${env:HOME}/gotools",
    "[go]": {
        "editor.formatOnSave": true
    },
    "go.useLanguageServer": true,
    "go.vetOnSave": "package",
    "go.formatTool": "goimports",
    "go.lintTool": "golangci-lint"
}

Describe the bug

When I do Cmd+Shift+P and click "Go: Install/Update Tools", it does not include goimports, even though I have set it in "go.formatTool".

Steps to reproduce the behavior:

  1. Set "go.formatTool": "goimports" in user or workspace settings.
  2. Do Cmd+Shift+P and click "Go: Install/Update Tools".

Screenshots or recordings

Image

It should also be noted that upon saving the settings file, it gives a popup to install goimports. But this is the only way to do so.

Image

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions