Closed JiriSko closed 3 years ago
Maybe revive -help
can show the current SHA. In general, I am hoping us to not have to stick to a particular version. Instead, revive is supposed to be an "evergreen" tool that anyone can use the last version of. That's one of the reasons I was originally against introducing semver to the project.
That would be helpful. I just want to see in my pipeline which version I'm using and this would be enough.
+1 golint doesnt provide any information and i was hoping for this tool to provide such information on top of golint
@mgechev I also need --version for Mega-Linter , please :)
I can do this if this PR (#503) got approved/released, since goreleaser already provide these info from git as ldflags during build. it is just a matter of adding the following vars to main.go
and create a command to return them.
var (
version = "dev"
commit = "none"
date = "unknown"
builtBy = "unknown"
)
// in the --version or --help command handler
fmt.Sprintf(
`Current revive Version %v Commit %v, Built @%v By %v.`,
version,
commit,
date,
builtBy,
),
if you're building revive manually, then it is your responsibility to provide the version during build (eg. go build -v -ldflags="-X 'main.version=v1.0.0' -X 'main.commit=46f65914e3b26f7044ffe6842ecce10b58e2c2aa' -X 'main.date=@2021-03-21T21:37:16Z' -X 'main.builtBy=clivern'"
) or it will be unknown, same goes for commit
, date
, builtBy
@Clivern #503 is merged ;)
yeah, i will take care of this request then @chavacava
Hi, thanks for this great tool.
Would be possible to add application version support in standard way? I mean to add
--version
CLI option which shows revive version.