你使用的Go版本、VS Code和VS Code Go扩展是什么?
- 通过运行
go version
命令从 VS Code集成终端 获取Go的版本。 go version go1.16.3 darwin/amd64
- 通过运行
gopls -v version
命令从 VS Code集成终端 获取Gopls的版本。
输出:
- Build info
----------
golang.org/x/tools/gopls v0.7.1
golang.org/x/tools/gopls@v0.7.1 h1:Mh3Z8Xcoq3Zy7ksSlwDV/nzQSbjFf06A+L+F8YHq55U=
github.com/BurntSushi/toml@v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
github.com/google/go-cmp@v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU=
github.com/sergi/go-diff@v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=
golang.org/x/mod@v0.4.2 h1:Gz96sIWK3OalVv/I/qNygP42zyoKp3xptRVCWRFEBvo=
golang.org/x/sync@v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ=
golang.org/x/sys@v0.0.0-20210510120138-977fb7262007 h1:gG67DSER+11cZvqIMb8S8bt0vZtiN6xWYARwirrOSfE=
golang.org/x/tools@v0.1.6-0.20210802203754-9b21a8868e16 h1:ZC/gVBZl8poJyKzWLxxlsmhayVGosF4mohR35szD5Bg=
golang.org/x/xerrors@v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=
honnef.co/go/tools@v0.2.0 h1:ws8AfbgTX3oIczLPNPCu5166oBg9ST2vNs0rcht+mDE=
mvdan.cc/gofumpt@v0.1.1 h1:bi/1aS/5W00E2ny5q65w9SnKpWEF/UIOqDYBILpo9rA=
mvdan.cc/xurls/v2@v2.2.0 h1:NSZPykBXJFCetGZykLAxaL6SIpvbVy/UFEniIfHAa8A=
- 通过运行
code -v
或code-insiders -v
命令获取VS Code或VS Code Insiders的版本。 zsh: command not found: code
- 检查已安装的扩展以获取VS Code Go扩展的版本
v0.27.1
- 运行 Ctrl+Shift+P (Cmd+Shift+P on Mac OS) >
Go: Locate Configured Go Tools
命令。
输出:
Checking configured tools....
GOBIN: undefined
toolsGopath:
gopath: /Users/my.user/go
GOROOT: /usr/local/go
PATH: /Users/my.user/.pyenv/shims:/Users/my.user/.pyenv/bin:/Users/my.user/.nvm/versions/node/v15.10.0/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/go/bin:/Library/Apple/usr/bin:/Users/my.user/go/bin
go: /usr/local/go/bin/go: go version go1.16.3 darwin/amd64
gopkgs: /Users/my.user/go/bin/gopkgs: go1.16.3
path github.com/uudashr/gopkgs/v2/cmd/gopkgs
mod github.com/uudashr/gopkgs/v2 v2.1.2 h1:A0+QH6wqNRHORJnxmqfeuBEsK4nYQ7pgcOHhqpqcrpo=
dep github.com/karrick/godirwalk v1.12.0 h1:nkS4xxsjiZMvVlazd0mFyiwD4BR9f3m6LXGhM2TUx3Y=
dep github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I=
go-outline: /Users/my.user/go/bin/go-outline: go1.16.3
path github.com/ramya-rao-a/go-outline
mod github.com/ramya-rao-a/go-outline v0.0.0-20210608161538-9736a4bde949 h1:iaD+iVf9xGfajsJp+zYrg9Lrk6gMJ6/hZHO4cYq5D5o=
dep golang.org/x/tools v0.1.1 h1:wGiQel/hW0NnEkJUk8lbzkX2gFJU6PFxf1v5OlCfuOs=
gotests: /Users/my.user/go/bin/gotests: go1.16.3
path github.com/cweill/gotests/gotests
mod github.com/cweill/gotests v1.6.0 h1:KJx+/p4EweijYzqPb4Y/8umDCip1Cv6hEVyOx0mE9W8=
dep golang.org/x/tools v0.0.0-20191109212701-97ad0ed33101 h1:LCmXVkvpQCDj724eX6irUTPCJP5GelFHxqGSWL2D1R0=
gomodifytags: /Users/my.user/go/bin/gomodifytags: go1.16.3
path github.com/fatih/gomodifytags
mod github.com/fatih/gomodifytags v1.13.0 h1:fmhwoecjZ5c34Q2chjRB9cL8Rgag+1TOSMy+grissMc=
dep github.com/fatih/camelcase v1.0.0 h1:hxNvNX/xYBp0ovncs8WyWZrOrpBNub/JfaMvbURyft8=
dep github.com/fatih/structtag v1.2.0 h1:/OdNE99OxoI/PqaW/SuSK9uxxT3f/tcSZgon/ssNSx4=
dep golang.org/x/tools v0.0.0-20180824175216-6c1c5e93cdc1 h1:EAPsk8kfGCjxQagrkWjzXlUWe2p3gj5MknO+z2o9GKc=
impl: /Users/my.user/go/bin/impl: go1.16.3
path github.com/josharian/impl
mod github.com/josharian/impl v1.1.0 h1:gafhg1OFVMq46ifdkBa8wp4hlGogjktjjA5h/2j4+2k=
dep golang.org/x/mod v0.2.0 h1:KU7oHjnv3XNWfa5COkzUifxZmxp1TyI7ImMXqFxLwvQ=
dep golang.org/x/tools v0.0.0-20200522201501-cb1345f3a375 h1:SjQ2+AKWgZLc1xej6WSzL+Dfs5Uyd5xcZH1mGC411IA=
dep golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
goplay: /Users/my.user/go/bin/goplay: go1.16.3
path github.com/haya14busa/goplay/cmd/goplay
mod github.com/haya14busa/goplay v1.0.0 h1:ED4BMrGQ3WH7H3YXrcnWMVzj1xeSepaYTkLh1DtFi/4=
dep github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966 h1:JIAuq3EEf9cgbU6AtGPK4CTG3Zf6CKMNqf0MHTggAUA=
dlv: /Users/my.user/go/bin/dlv: go1.16.3
path github.com/go-delve/delve/cmd/dlv
mod github.com/go-delve/delve v1.7.0 h1:MaWAD3LtvjE/LL98urSHPjaMT+OubpQ2sqF3R2Uj1rc=
dep github.com/cosiner/argv v0.1.0 h1:BVDiEL32lwHukgJKP87btEPenzrrHUjajs/8yzaqcXg=
dep github.com/cpuguy83/go-md2man v1.0.10 h1:BSKMNlYxDvnunlTymqtgONjNnaRV1sTpcovwwjF22jk=
dep github.com/google/go-dap v0.5.0 h1:RMHAVn5xeunBakYk65ggHXttk6qjZVdbmi+xhAoL2wY=
dep github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc=
dep github.com/mattn/go-isatty v0.0.3 h1:ns/ykhmWi7G9O+8a448SecJU3nSMBXJfqQkl0upE1jI=
dep github.com/peterh/liner v0.0.0-20170317030525-88609521dc4b h1:8uaXtUkxiy+T/zdLWuxa/PG4so0TPZDZfafFNNSaptE=
dep github.com/russross/blackfriday v1.5.2 h1:HyvC0ARfnZBqnXwABFeSZHpKvJHJJfPz81GNueLj0oo=
dep github.com/sirupsen/logrus v1.6.0 h1:UBcNElsrwanuuMsnGSlYmtmgbb23qDR5dG+6X6Oo89I=
dep github.com/spf13/cobra v0.0.0-20170417170307-b6cb39589372 h1:eRfW1vRS4th8IX2iQeyqQ8cOUNOySvAYJ0IUvTXGoYA=
dep github.com/spf13/pflag v0.0.0-20170417173400-9e4c21054fa1 h1:7bozMfSdo41n2NOc0GsVTTVUiA+Ncaj6pXNpm4UHKys=
dep go.starlark.net v0.0.0-20200821142938-949cc6f4b097 h1:YiRMXXgG+Pg26t1fjq+iAjaauKWMC9cmGFrtOEuwDDg=
dep golang.org/x/arch v0.0.0-20190927153633-4e8777c89be4 h1:QlVATYS7JBoZMVaf+cNjb90WD/beKVHnIxFKT4QaHVI=
dep golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae h1:Ih9Yo4hSPImZOpfGuA4bR/ORKTAbhZo2AbWNRCnevdo=
dep gopkg.in/yaml.v2 v2.2.1 h1:mUhvW9EsL+naU5Q3cakzfE91YhliOondGd6ZrsDBHQE=
dlv-dap: /Users/my.user/go/bin/dlv-dap: go1.16.3
path github.com/go-delve/delve/cmd/dlv
mod github.com/go-delve/delve v1.7.1-0.20210804080032-f95340ae1bf9 h1:MNF+leMBsgJoT80cCoVJOsZWIJQlAOdTHgn0VslfJ6k=
dep github.com/cosiner/argv v0.1.0 h1:BVDiEL32lwHukgJKP87btEPenzrrHUjajs/8yzaqcXg=
dep github.com/cpuguy83/go-md2man/v2 v2.0.0 h1:EoUDS0afbrsXAZ9YQ9jdu/mZ2sXgT1/2yyNng4PGlyM=
dep github.com/google/go-dap v0.5.0 h1:RMHAVn5xeunBakYk65ggHXttk6qjZVdbmi+xhAoL2wY=
dep github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc=
dep github.com/mattn/go-isatty v0.0.3 h1:ns/ykhmWi7G9O+8a448SecJU3nSMBXJfqQkl0upE1jI=
dep github.com/peterh/liner v0.0.0-20170317030525-88609521dc4b h1:8uaXtUkxiy+T/zdLWuxa/PG4so0TPZDZfafFNNSaptE=
dep github.com/russross/blackfriday/v2 v2.0.1 h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0RK8m9o+Q=
dep github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo=
dep github.com/sirupsen/logrus v1.6.0 h1:UBcNElsrwanuuMsnGSlYmtmgbb23qDR5dG+6X6Oo89I=
dep github.com/spf13/cobra v1.1.3 h1:xghbfqPkxzxP3C/f3n5DdpAbdKLj4ZE4BWQI362l53M=
dep github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
dep go.starlark.net v0.0.0-20200821142938-949cc6f4b097 h1:YiRMXXgG+Pg26t1fjq+iAjaauKWMC9cmGFrtOEuwDDg=
dep golang.org/x/arch v0.0.0-20190927153633-4e8777c89be4 h1:QlVATYS7JBoZMVaf+cNjb90WD/beKVHnIxFKT4QaHVI=
dep golang.org/x/sys v0.0.0-20210514084401-e8d321eab015 h1:hZR0X1kPW+nwyJ9xRxqZk1vx5RUObAPBdKVvXPDUH/E=
dep gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
golint: /Users/my.user/go/bin/golint: go1.16.3
path golang.org/x/lint/golint
mod golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 h1:VLliZ0d+/avPrXXH+OakdXhpJuEoBZuwh1m2j7U6Iug=
dep golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7 h1:EBZoQjiKKPaLbPrbpssUfuHtwM6KV/vb4U85g/cigFY=
gopls: /Users/my.user/go/bin/gopls: go1.16.3
path golang.org/x/tools/gopls
mod golang.org/x/tools/gopls v0.7.1 h1:Mh3Z8Xcoq3Zy7ksSlwDV/nzQSbjFf06A+L+F8YHq55U=
dep github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
dep github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU=
dep github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=
dep golang.org/x/mod v0.4.2 h1:Gz96sIWK3OalVv/I/qNygP42zyoKp3xptRVCWRFEBvo=
dep golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ=
dep golang.org/x/sys v0.0.0-20210510120138-977fb7262007 h1:gG67DSER+11cZvqIMb8S8bt0vZtiN6xWYARwirrOSfE=
dep golang.org/x/tools v0.1.6-0.20210802203754-9b21a8868e16 h1:ZC/gVBZl8poJyKzWLxxlsmhayVGosF4mohR35szD5Bg=
dep golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=
dep honnef.co/go/tools v0.2.0 h1:ws8AfbgTX3oIczLPNPCu5166oBg9ST2vNs0rcht+mDE=
dep mvdan.cc/gofumpt v0.1.1 h1:bi/1aS/5W00E2ny5q65w9SnKpWEF/UIOqDYBILpo9rA=
dep mvdan.cc/xurls/v2 v2.2.0 h1:NSZPykBXJFCetGZykLAxaL6SIpvbVy/UFEniIfHAa8A=
go env
Workspace Folder (smartequip-common-go): /Users/my.user/git/smartequip-common-go
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/my.user/Library/Caches/go-build"
GOENV="/Users/my.user/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/my.user/go/pkg/mod"
GONOPROXY="github.com/cfacorp,git.cloud.riot.cfahome.com/riot-developers"
GONOSUMDB="github.com/cfacorp,git.cloud.riot.cfahome.com/riot-developers"
GOOS="darwin"
GOPATH="/Users/my.user/go"
GOPRIVATE="github.com/cfacorp,git.cloud.riot.cfahome.com/riot-developers"
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GOVCS=""
GOVERSION="go1.16.3"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/my.user/git/smartequip-common-go/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/x7/jzrn96rn02765bbr_chytlh80000gn/T/go-build1385492950=/tmp/go-build -gno-record-gcc-switches -fno-common"
Workspace Folder (smartequip-certifier): /Users/my.user/git/smartequip-certifier
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/my.user/Library/Caches/go-build"
GOENV="/Users/my.user/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/my.user/go/pkg/mod"
GONOPROXY="github.com/cfacorp,git.cloud.riot.cfahome.com/riot-developers"
GONOSUMDB="github.com/cfacorp,git.cloud.riot.cfahome.com/riot-developers"
GOOS="darwin"
GOPATH="/Users/my.user/go"
GOPRIVATE="github.com/cfacorp,git.cloud.riot.cfahome.com/riot-developers"
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GOVCS=""
GOVERSION="go1.16.3"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/my.user/git/smartequip-certifier/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/x7/jzrn96rn02765bbr_chytlh80000gn/T/go-build2457837107=/tmp/go-build -gno-record-gcc-switches -fno-common"
Workspace Folder (tests): /Users/my.user/git/smartequip-certifier/tests
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/my.user/Library/Caches/go-build"
GOENV="/Users/my.user/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/my.user/go/pkg/mod"
GONOPROXY="github.com/cfacorp,git.cloud.riot.cfahome.com/riot-developers"
GONOSUMDB="github.com/cfacorp,git.cloud.riot.cfahome.com/riot-developers"
GOOS="darwin"
GOPATH="/Users/my.user/go"
GOPRIVATE="github.com/cfacorp,git.cloud.riot.cfahome.com/riot-developers"
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GOVCS=""
GOVERSION="go1.16.3"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/my.user/git/smartequip-certifier/tests/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/x7/jzrn96rn02765bbr_chytlh80000gn/T/go-build3326164392=/tmp/go-build -gno-record-gcc-switches -fno-common"
Workspace Folder (dbquery): /Users/my.user/git/smartequip-lambdas/dbquery
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/my.user/Library/Caches/go-build"
GOENV="/Users/my.user/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/my.user/go/pkg/mod"
GONOPROXY="github.com/cfacorp,git.cloud.riot.cfahome.com/riot-developers"
GONOSUMDB="github.com/cfacorp,git.cloud.riot.cfahome.com/riot-developers"
GOOS="darwin"
GOPATH="/Users/my.user/go"
GOPRIVATE="github.com/cfacorp,git.cloud.riot.cfahome.com/riot-developers"
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GOVCS=""
GOVERSION="go1.16.3"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/my.user/git/smartequip-lambdas/dbquery/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/x7/jzrn96rn02765bbr_chytlh80000gn/T/go-build2736917249=/tmp/go-build -gno-record-gcc-switches -fno-common"
Workspace Folder (sdk-go): /Users/my.user/git/sdk-go
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/my.user/Library/Caches/go-build"
GOENV="/Users/my.user/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/my.user/go/pkg/mod"
GONOPROXY="github.com/cfacorp,git.cloud.riot.cfahome.com/riot-developers"
GONOSUMDB="github.com/cfacorp,git.cloud.riot.cfahome.com/riot-developers"
GOOS="darwin"
GOPATH="/Users/my.user/go"
GOPRIVATE="github.com/cfacorp,git.cloud.riot.cfahome.com/riot-developers"
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GOVCS=""
GOVERSION="go1.16.3"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/my.user/git/sdk-go/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/x7/jzrn96rn02765bbr_chytlh80000gn/T/go-build2709731396=/tmp/go-build -gno-record-gcc-switches -fno-common"
Workspace Folder (nicehttp): /Users/my.user/git/nicehttp
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/my.user/Library/Caches/go-build"
GOENV="/Users/my.user/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/my.user/go/pkg/mod"
GONOPROXY="github.com/cfacorp,git.cloud.riot.cfahome.com/riot-developers"
GONOSUMDB="github.com/cfacorp,git.cloud.riot.cfahome.com/riot-developers"
GOOS="darwin"
GOPATH="/Users/my.user/go"
GOPRIVATE="github.com/cfacorp,git.cloud.riot.cfahome.com/riot-developers"
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GOVCS=""
GOVERSION="go1.16.3"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/my.user/git/nicehttp/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/x7/jzrn96rn02765bbr_chytlh80000gn/T/go-build664731063=/tmp/go-build -gno-record-gcc-switches -fno-common"
Workspace Folder (cfa-react-starter): /Users/my.user/git/cfa-react-starter
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/my.user/Library/Caches/go-build"
GOENV="/Users/my.user/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/my.user/go/pkg/mod"
GONOPROXY="github.com/cfacorp,git.cloud.riot.cfahome.com/riot-developers"
GONOSUMDB="github.com/cfacorp,git.cloud.riot.cfahome.com/riot-developers"
GOOS="darwin"
GOPATH="/Users/my.user/go"
GOPRIVATE="github.com/cfacorp,git.cloud.riot.cfahome.com/riot-developers"
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GOVCS=""
GOVERSION="go1.16.3"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/dev/null"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/x7/jzrn96rn02765bbr_chytlh80000gn/T/go-build2756984840=/tmp/go-build -gno-record-gcc-switches -fno-common"
Workspace Folder (okta-samples-js-react): /Users/my.user/git/okta-samples-js-react
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/my.user/Library/Caches/go-build"
GOENV="/Users/my.user/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/my.user/go/pkg/mod"
GONOPROXY="github.com/cfacorp,git.cloud.riot.cfahome.com/riot-developers"
GONOSUMDB="github.com/cfacorp,git.cloud.riot.cfahome.com/riot-developers"
GOOS="darwin"
GOPATH="/Users/my.user/go"
GOPRIVATE="github.com/cfacorp,git.cloud.riot.cfahome.com/riot-developers"
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GOVCS=""
GOVERSION="go1.16.3"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/dev/null"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/x7/jzrn96rn02765bbr_chytlh80000gn/T/go-build2600761484=/tmp/go-build -gno-record-gcc-switches -fno-common"
Workspace Folder (update-cdn): /Users/my.user/git/update-cdn
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/my.user/Library/Caches/go-build"
GOENV="/Users/my.user/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/my.user/go/pkg/mod"
GONOPROXY="github.com/cfacorp,git.cloud.riot.cfahome.com/riot-developers"
GONOSUMDB="github.com/cfacorp,git.cloud.riot.cfahome.com/riot-developers"
GOOS="darwin"
GOPATH="/Users/my.user/go"
GOPRIVATE="github.com/cfacorp,git.cloud.riot.cfahome.com/riot-developers"
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GOVCS=""
GOVERSION="go1.16.3"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/my.user/git/update-cdn/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/x7/jzrn96rn02765bbr_chytlh80000gn/T/go-build904331187=/tmp/go-build -gno-record-gcc-switches -fno-common"
Workspace Folder (ots-go-framework-core): /Users/my.user/git/ots-go-framework-core
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/my.user/Library/Caches/go-build"
GOENV="/Users/my.user/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/my.user/go/pkg/mod"
GONOPROXY="github.com/cfacorp,git.cloud.riot.cfahome.com/riot-developers"
GONOSUMDB="github.com/cfacorp,git.cloud.riot.cfahome.com/riot-developers"
GOOS="darwin"
GOPATH="/Users/my.user/go"
GOPRIVATE="github.com/cfacorp,git.cloud.riot.cfahome.com/riot-developers"
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GOVCS=""
GOVERSION="go1.16.3"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/my.user/git/ots-go-framework-core/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/x7/jzrn96rn02765bbr_chytlh80000gn/T/go-build614227715=/tmp/go-build -gno-record-gcc-switches -fno-common"
分享你添加/编辑的与Go相关的设置
运行 Preferences: Open Settings (JSON)
命令打开settings.json文件。
使用 go.
或 ["go"]
或 gopls
前缀分享所有设置。
- 我的Go和git设置如下:
{
"go.formatTool": "goimports",
"go.enableCodeLens": {
"references": false,
"runtest": false
},
"go.toolsManagement.autoUpdate": true,
"go.lintTool": "golint",
"git.enabled": false,
}
描述bug
当我更改了文件的大小写后,VSCode Go陷入了不良状态,并认为存在重复文件。然而,项目可以正常编译,文件系统中只存在一个文件,并且在git中也只有一个文件。请参阅屏幕截图:如果你查看顶部,我会悬停在包名上以显示错误。我尝试了以下步骤来解决此问题:
- 重启VSCode
- 将所有vscode Go工具更新到最新版本
- 删除有问题的文件+文件夹,提交到git,然后手动将它们复制回项目中,然后再次提交。
- 通过
Clear Editor History
清除VSCode的文件缓存 - 在VSCode中禁用git
重现行为的方法:
- 将文件
emailTemplates.go
重命名为emailtemplates.go
- 将文件夹
emailTemplates
重命名为emailtemplates
- 查看错误
6条答案
按热度按时间gc0ot86w1#
感谢您报告此问题并提供重现步骤。当文件大小写更改时,我们可能未正确使元数据失效。
yiytaume2#
我正在经历相同的问题,但在我的情况下,在VS code重启后,错误会随机出现并消失。
lg40wkob3#
我也遇到过这个问题。VSCode在迅速分配超过30GB的RAM后不久就崩溃了,导致内存不足(OOM)。
zrfyljdw4#
我唯一能解决这个问题的方法是关闭VSCode,重命名项目文件夹和模块(go.mod),然后再次打开项目。这不是一个可持续的妥协。
在等待解决问题的同时,我们有什么更好的方法吗?比如删除隐藏在某个地方的缓存或元数据存储?由于这个问题还导致了其他严重的问题,例如保存操作会随机截取任意位置的字符,以及“转到定义”功能会跳转到完全随机的符号。
vd2z7a6w5#
遇到了相同的问题,仍然没有修复吗?为什么在VSCode仓库中没有关于这个问题的链接,这肯定是问题的根源吗?
yc0p9oo06#
我尝试了不同的解决方案,包括卸载vscode扩展,但没有起作用,直到我删除了文件并重新创建(使用相同的名称)并粘贴了相同的内容。