What version of Go, VS Code & VS Code Go extension are you using?
- Run
go version to get version of Go
- go version go1.15.5 linux/amd64
- Run
gopls -v version to get version of Gopls if you are using the language server.
- golang.org/x/tools/gopls v0.5.3
- Run
code -v or code-insiders -v to get version of VS Code or VS Code Insiders
- Check your installed extensions to get the version of the VS Code Go extension
- Run
go env to get the go development environment details
- GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/df/.cache/go-build"
GOENV="/home/df/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/df/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/df/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/c/Python/Go/Crypto/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 -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build490426795=/tmp/go-build -gno-record-gcc-switches"
Share the Go related settings you have added/edited
// #region GO
"go.useLanguageServer": true,
"go.languageServerFlags": [
"-rpc.trace"
],
"go.languageServerExperimentalFeatures": {
"diagnostics": true,
"documentLink": true,
"format": true
},
"[go]": {
"editor.insertSpaces": false,
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.organizeImports": true
},
// "editor.snippetSuggestions": "none"
},
"[go.mod]": {
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.organizeImports": true
},
},
"gopls": {
"completeUnimported": true,
"deepCompletion": true,
"usePlaceholders": true,
"staticcheck":true
},
// #endregion GO
Describe the bug
Some snippets with "var" as the default name produce Error: "expected 1 expression"
Steps to reproduce the behavior:
- Type
forr and iterate over a slice using a default "var" name
- Error: "expected 1 expression"
- Change name of "var" to any other name - error is gone
Screenshots or recordings

What version of Go, VS Code & VS Code Go extension are you using?
go versionto get version of Gogopls -v versionto get version of Gopls if you are using the language server.code -vorcode-insiders -vto get version of VS Code or VS Code Insidersgo envto get the go development environment detailsGOARCH="amd64"
GOBIN=""
GOCACHE="/home/df/.cache/go-build"
GOENV="/home/df/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/df/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/df/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/c/Python/Go/Crypto/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 -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build490426795=/tmp/go-build -gno-record-gcc-switches"
Share the Go related settings you have added/edited
Describe the bug
Some snippets with "var" as the default name produce Error: "expected 1 expression"
Steps to reproduce the behavior:
forrand iterate over a slice using a default "var" nameScreenshots or recordings