bwplotka / bingo

Like `go get` but for Go tools! CI Automating versioning of Go binaries in a nested, isolated Go modules.
Apache License 2.0
342 stars 29 forks source link

List by package fail when list by binary name works #105

Open mbideau opened 2 years ago

mbideau commented 2 years ago

bingo version output:

❯ bingo version
v0.5.1

go version output:

❯ go version
go version go1.15.9 linux/amd64

What happened: listing of installed module/package failed

What you expected to happen: listing of installed module/package succeed and print out the package line

How to reproduce it (as minimally and precisely as possible):

❯ (cd $(mktemp -d) && pwd && bingo get -v -l github.com/BurntSushi/toml/cmd/tomlv && bingo list tomlv && bingo list github.com/BurntSushi/toml/cmd/tomlv || bingo list github.com/BurntSushi/toml/cmd/tomlv@v0.4.1)
/tmp/tmp.SYM36q1KWe
Bingo not used before here, creating directory for pinned modules for you at .bingo
getting target github.com/BurntSushi/toml/cmd/tomlv (module  )
exec 'go mod init -modfile=/tmp/tmp.SYM36q1KWe/.bingo/tomlv-e.tmp.mod _'
exec 'go get -modfile=/tmp/tmp.SYM36q1KWe/.bingo/tomlv-e.tmp.mod -d github.com/BurntSushi/toml/cmd/tomlv'
exec 'go env GOPATH'
exec 'go mod init -modfile=/tmp/tmp.SYM36q1KWe/.bingo/tomlv.tmp.mod _'
exec 'go list -modfile=/tmp/tmp.SYM36q1KWe/.bingo/tomlv.tmp.mod -mod=mod -f={{.Name}} github.com/BurntSushi/toml/cmd/tomlv'
exec 'go build -modfile=/tmp/tmp.SYM36q1KWe/.bingo/tomlv.tmp.mod -o=tomlv-v0.4.1 github.com/BurntSushi/toml/cmd/tomlv'

Name    Binary Name Package @ Version               Build EnvVars   Build Flags
----    ----------- -----------------               -------------   -----------
tomlv   tomlv-v0.4.1    github.com/BurntSushi/toml/cmd/tomlv@v0.4.1         

Name    Binary Name Package @ Version   Build EnvVars   Build Flags
----    ----------- -----------------   -------------   -----------
Error: list command failed: Pinned tool github.com/BurntSushi/toml/cmd/tomlv not found

Name    Binary Name Package @ Version   Build EnvVars   Build Flags
----    ----------- -----------------   -------------   -----------
Error: list command failed: Pinned tool github.com/BurntSushi/toml/cmd/tomlv@v0.4.1 not found

As you can see, the first invocation bingo list tomlv succeed, but the two following failed using :

bwplotka commented 2 years ago

Thanks for reporting, and sorry for lag!