Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/go: unclear error message when applying a 'replace' directive with an absolute path and explicit version #36888

Closed
duffiye opened this issue Jan 30, 2020 · 2 comments
Labels
FrozenDueToAge modules NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Milestone

Comments

@duffiye
Copy link

duffiye commented Jan 30, 2020

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

$ go version
go1.13

Does this issue reproduce with the latest release?

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

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/duffiye/Library/Caches/go-build"
GOENV="/Users/duffiye/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/duffiye/code/golang"
GOPRIVATE=""
GOPROXY="https://goproxy.cn,direct"
GOROOT="/usr/local/opt/go/libexec"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/opt/go/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/duffiye/code/erp/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/mh/k6gqtvlj1s1fkz6brhkp6j2r0000gn/T/go-build412083276=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

go mod edit -replace=github.com/apache/rocketmq-client-go@v0.0.0=/Users/duffiye/code/rocketmq-client-go@latest

malformed module path "/Users/duffiye/code/rocketmq-client-go": empty path element

What did you expect to see?

replace pkg github.com/apache/rocketmq-client-go

What did you see instead?

@bcmills
Copy link
Contributor

bcmills commented Jan 30, 2020

/Users/duffiye/code/rocketmq-client-go@latest is a bit nonsensical: absolute file paths are not versioned, so we do not include such a version in the replace statement.

That said, the diagnostic here could be a lot better. Do you get the same error message using go1.14beta1?

CC @matloob @jayconrod

@bcmills bcmills added modules NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Jan 30, 2020
@bcmills bcmills changed the title go mod replace error:malformed module path "xxx": empty path element cmd/go: unclear error message when applying a 'replace' directive with an absolute path and explicit version Jan 30, 2020
@bcmills bcmills added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Jan 30, 2020
@bcmills bcmills added this to the Backlog milestone Jan 30, 2020
@gopherbot
Copy link

Timed out in state WaitingForInfo. Closing.

(I am just a bot, though. Please speak up if this is a mistake or you have the requested information.)

@golang golang locked and limited conversation to collaborators Mar 1, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge modules NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

3 participants