My go workspace is simple:
[000]kdr2@Debian-X230:~/gows$ pwd
/home/kdr2/gows
[000]kdr2@Debian-X230:~/gows$ tree
.
└── src
└── test
└── m.go
2 directories, 1 file
And the content of m.go
is from https://raw.githubusercontent.com/facebookgo/grace/master/gracedemo/demo.go . All ENV variables are set.
When I run go get -v -x test
, all goes well, it downloads the dependencies and build out an executable. But when I run go get -v -x -pkgdir pkg-1 test
, it leads to an error:
...
mkdir -p $WORK/net/http/_obj/
cd /usr/local/go-1.8/src/net/http
/usr/local/go-1.8/pkg/tool/linux_amd64/compile -o $WORK/net/http.a -trimpath $WORK -p net/http -complete -buildid 49a4487ab4c506c0ef8aa1f5f4ceea3fc8b1243d -importmap golang_org/x/net/http2/hpack=vendor/golang_org/x/net/http2/hpack -importmap golang_org/x/net/idna=vendor/golang_org/x/net/idna -importmap golang_org/x/net/lex/httplex=vendor/golang_org/x/net/lex/httplex -importmap golang_org/x/text/unicode/norm=vendor/golang_org/x/text/unicode/norm -importmap golang_org/x/text/width=vendor/golang_org/x/text/width -D _/usr/local/go-1.8/src/net/http -I $WORK -I pkg-1 -pack ./client.go ./cookie.go ./doc.go ./filetransport.go ./fs.go ./h2_bundle.go ./header.go ./http.go ./jar.go ./method.go ./request.go ./response.go ./server.go ./sniff.go ./status.go ./transfer.go ./transport.go
cp $WORK/net/http.a pkg-1/net/http.a
github.com/facebookgo/httpdown
mkdir -p $WORK/github.com/facebookgo/httpdown/_obj/
cd /home/kdr2/gows/src/github.com/facebookgo/httpdown
/usr/local/go-1.8/pkg/tool/linux_amd64/compile -o $WORK/github.com/facebookgo/httpdown.a -trimpath $WORK -p github.com/facebookgo/httpdown -complete -buildid 45d38b6b6de48eff9fe8461b5764b769ea669b4c -D _/home/kdr2/gows/src/github.com/facebookgo/httpdown -I $WORK -I pkg-1 -pack ./httpdown.go
# github.com/facebookgo/httpdown
src/github.com/facebookgo/httpdown/httpdown.go:16: can't find import: "github.com/facebookgo/clock"
[002]kdr2@Debian-X230:~/gows$
When I run go build -v -x -pkgdir pkg-1 test
, the executable can be built well, but it does not create a pkg-1
dir to place the tmp files.
So, my question is, how to use -pkgdir
with go get and go build? does -pkgdir
work as what its document says?
Thanks.
So, my question is, how to use
-pkgdir
with go get and go build? does-pkgdir
work as what its document says?
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
What is the problem you are trying to solve by using -a to force recompilation of everything.