-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Description
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 => ../errorstry to build your application
What did you expect to see?
- my application to build succefully without problem(using the cloned errors package)
What did you see instead?
go: parsing ../errors/go.mod: open ~/mystuff/errors/go.mod: no such file or directory
go: error loading module requirementsHowever, if I manually add a go.mod file to the cloned errors package
echo 'module "github.com/pkg/errors"' >> ~/mystuff/errors/go.modI'm able to build my application using that local errors package.