Closed
Description
Hi guys,
I have some troubles with the extension and git submodules.
What version of Go, VS Code & VS Code Go extension are you using?
- Run
go version
to get version of Go- go1.14.5 linux/amd64
- Run
code -v
orcode-insiders -v
to get version of VS Code or VS Code Insiders- 1.48.0-insider
- Check your installed extensions to get the version of the VS Code Go extension
- v0.15.2
- Run
go env
to get the go development environment details
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/patricio/.cache/go-build"
GOENV="/home/patricio/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/patricio/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/lib/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
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-build939111051=/tmp/go-build -gno-record-gcc-switches"
Share the Go related settings you have added/edited
{
"go.autocompleteUnimportedPackages": true,
"go.formatTool": "goimports",
"go.buildOnSave": "workspace",
"go.useLanguageServer": true
}
Describe the bug
Problem
I have a project with two components:
- Backend with golang using go modules.
- Frontend with vue
Both components are git submodules in a parent repository. When I open the project with both submodules I have the following issues:
- Module dependencies are not imported (
autocompleteUnimportedPackages
) - Error with packages already imported
Opening directly submodule resolves the issue.
Behavior expected
I expect same behavior with git submodules and simple git project.
Steps to reproduce the behavior:
- Clone a project with git submodules (with golang modules inside).
- Init and update submodules.
- Open main.go file
- See errors in packages imported already declared in go.mod file.
Screenshots or recordings
Project opened with git submodules:
Project opened directly: