'S.O.S. Visual Studio can't run go file, go: no such tool "asm"
I've been learning Go in Visual Studio Code and wasn't having any problems until I tried to create a mod file for the first time this morning. Now, whenever I try to run my code or reinstall Go tools, I get stopped by this error: go: no such tool "asm"
I would appreciate detailed help (remember I'm a novice) on how to resolve this. I've tried uninstalling and reinstalling Visual Studio Code, GO, and the GO extension in Visual Studio Code to no avail.
I've seen one other thread about a problem like this but it didn't give any understandable/detailed answers.
In case it helps here is the output from "go tool" and "go env".
Running "go tool" in my terminal gives:
addr2line
buildid
cgo
compile
cover
dist
doc
fix
go_bootstrap
link
nm
objdump
pack
pprof
test2json
trace
vet
Running "go env" gives:
set GO111MODULE=
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\cbh2132\AppData\Local\go-build
set GOENV=C:\Users\cbh2132\AppData\Roaming\go\env
set GOEXE=.exe
set GOEXPERIMENT=
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GOMODCACHE=C:\Users\cbh2132\go\pkg\mod
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=C:\Users\cbh2132\go
set GOPRIVATE=
set GOPROXY=https://proxy.golang.org,direct
set GOROOT=C:\Program Files\Go
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLDIR=C:\Program Files\Go\pkg\tool\windows_amd64
set GOVCS=
set GOVERSION=go1.18.2
set GCCGO=gccgo
set GOAMD64=v1
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=NUL
set GOWORK=
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\cbh2132\AppData\Local\Temp\go-build1320767531=/tmp/go-build -gno-record-gcc-switches
Solution 1:[1]
I managed to solve this problem! So, even when I uninstalled Golang...I still had a file called "go" with all the package tools (e.g. asm.exe, etc) that was in my documents folder. I had to delete that file after uninstalling go and then reinstall go as well as the go tools in Visual Studio Code. Now it seems to be working again! This is such a relief.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Carl B Horton |
