-
Notifications
You must be signed in to change notification settings - Fork 17.6k
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: clarify documentation for -replace flag #26417
Comments
I think this is answered by #25739 (comment). Please shout if not. |
Actually, @rsc @bcmills might we want to slightly enhance the
to read:
or some such? |
yeah, that would be helpful. also the documentation has a typo( I think). it says The -replace=old@v=new@w ... and further down it says If the @v in new@v is omitted, I believe the latter should read; If the @w in new@w is omitted |
|
And maybe, |
@bcmills If the @v in new@v is omitted, the new path should be a directory on the local system shouldn't it read? If the @w in new@w is omitted, the new path should be a directory on the local system |
As we now allow
|
Change https://golang.org/cl/126155 mentions this issue: |
We can add unversioned paths via -replace; -dropreplace must be able to drop them. Fixes golang#26417. Change-Id: Ic05e9ae2ad80c008e11b195695cbb9d0fc8dbc0a Reviewed-on: https://go-review.googlesource.com/126155 Run-TryBot: Bryan C. Mills <bcmills@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Russ Cox <rsc@golang.org>
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?go version devel +b59b42cee8 Tue Jul 17 10:07:18 2018 +0000 darwin/amd64
Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?GOARCH="amd64"
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="
/go"/mystuff/meli/go.mod"GOMOD="
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/p5/56z0g6pj6dq0njc1n6wccz4r0000gn/T/go-build722725015=/tmp/go-build -gno-record-gcc-switches -fno-common"
What did you do?
try to use a go module replacement to point to a local repository
git clone https://github.com/pkg/errors to a place outside GOPATH
in your application's go.mod file add a replace directive to point to the cloned github.com/pkg/errors
cat go.mod
replace github.com/pkg/errors => ../errors
try to build your application
What did you expect to see?
What did you see instead?
go: parsing ../errors/go.mod: open ~/mystuff/errors/go.mod: no such file or directory go: error loading module requirements
However, if I manually add a go.mod file to the cloned errors package
I'm able to build my application using that local errors package.
The text was updated successfully, but these errors were encountered: