gobin icon indicating copy to clipboard operation
gobin copied to clipboard

Support package patterns that include ...

Open quite opened this issue 7 years ago • 6 comments

Gobin seems like a neat way to install my go tooling in a version wise controlled way, and at the same time keeping all dependencies out from $GOPATH.

One of the tools I use is @dominikh neat go tools, which unfortunately doesn't let themselves be installed using gobin:

$ gobin honnef.co/go/tools/...
failed to run go get -d honnef.co/go/tools/...: exit status 1
go: finding honnef.co/go/tools/... latest
go: finding honnef.co/go/tools latest
go get honnef.co/go/tools/...: no matching versions for query "latest"

Hm, did tagged version have to be in semver? Is that why...

quite avatar Jan 07 '19 14:01 quite

For what it's worth, Dominik avoiding semver is not by accident. Hopefully that's not a big blocker for tools like gobin.

mvdan avatar Jan 07 '19 14:01 mvdan

@mvdan FWIW gobin -u honnef.co/go/tools/cmd/staticcheck works fine. The problem here is the /... suffix.

rogpeppe avatar Jan 07 '19 15:01 rogpeppe

@quite - thanks for the report.

As @rogpeppe points out, the "issue" here is the ... package pattern; gobin currently doesn't know how to handle that.

As a short term workaround you can list the main packages you want explicitly.

The fix for this issue is to have any patterns passed to gobin expanded to "any main packages that match pattern X".

myitcv avatar Jan 07 '19 15:01 myitcv

Nice, I'll install like that! I changed the title, if we wanna keep this issue

quite avatar Jan 07 '19 15:01 quite

This is currently blocked on https://github.com/golang/go/issues/29363

myitcv avatar Jan 11 '19 17:01 myitcv

We can now try out https://go-review.googlesource.com/c/go/+/171138 on tip.

myitcv avatar Apr 16 '19 18:04 myitcv