Skip to content

cmd/go: project depending on project using modules not building: "error loading module requirements" #31929

Closed
@sab84

Description

@sab84

What version of Go are you using (go version)?

$ go version
go version go1.12.4 darwin/amd64

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/me/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/me/localrepo"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/Cellar/go/1.12.4/libexec"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.12.4/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/me/golangrepo/content-config/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 -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/0d/wcqqd_f523b517dqn0ghdwqc1qjkyx/T/go-build771363169=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

I have a project "a", which uses modules, that has dependency on code that is another project "b" which uses modules.

go.mod line # 1 in project "b":
module <private_gitlab_repo>/<group>/<subgroup>/<project "b" name>

import statement in project "a":
"<private_gitlab_repo>/<group>/<subgroup>/<project "b" name>.git/internal/parser"

What did you expect to see?

go build should complete correctly

What did you see instead?

go: <private_gitlab_repo>/<group>/<subgroup>/<project "b" name>[email protected]: parsing go.mod: unexpected module path "<private_gitlab_repo>/<group>/<subgroup>/<project "b" name>" go: error loading module requirements

What am I doing wrong ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.modules

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions