We are working with Go modules. I want in a CLI to get the specific version of a module. Is it possible?
If you are curious, the reason is that I want to add the following generate
command:
//go:generate go run github.com/golang/mock/mockgen -source="$GOPATH/pkg/mod/mymodules.com/mymodule@${VERSION}/module.go" -destination=module_mock.go
So I need to somehow get the version
Late but worth to mention, if you want to check the all available versions of a specific module:
go list -m -versions <module_name>
Like:
go list -m -versions github.com/user/module-name
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With