cmd/go: no place to install binary-only packages in module mode #28146
Labels
FrozenDueToAge
modules
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes with Go1.11.1
What operating system and processor architecture are you using (
go env
)?What did you do?
I want to vendor binary-only-package using go mod.
What did you expect to see?
First, I have written the package to expose as binary-only :
After build it, I have added
//go:binary-only-package
but build does not work anymore :go build p1: missing or invalid binary-only package; expected file ""
.But it's normal, because there is no target using go mod. Futhermore, using p1 in another package returns the same error.
So, I have produced a library like that :
go build -o p1.a
. But I do not know where to put my library because $GOPATH/pkg is not used. And go mod vendor makes vendored copy of source only.What did you see instead?
$GOPATH/pkg will be eliminated at next version. Is there a solution like binary-only-package?
Workaround
To workaround this trouble, I have used $GOROOT/pkg, but I think it's ugly.
The text was updated successfully, but these errors were encountered: