matryer / moq

Interface mocking tool for go generate
http://bit.ly/meetmoq
MIT License
2k stars 127 forks source link

Released version of moq does not print correct version #143

Closed breml closed 3 years ago

breml commented 3 years ago

I just downloaded the pre-compiled version of moq v0.2.0 from Github releases and it does not print the correct version:

$ moq -version
moq version dev

Expected:

$ moq -version
moq version v0.2.0
sudo-suhas commented 3 years ago

I had used goreleaser to build the binaries. Not sure why the version was not passed in using ldflags. Steps followed:

$ git tag --annotate --message="Release v0.2.0" v0.2.0
$ goreleaser release --rm-dist

@matryer Is there anything wrong with the above steps?

matryer commented 3 years ago

Those commands are slightly different to what I use, see the releasing.md

But I don't know why that would make a difference. Maybe @caarlos0 has an idea?

caarlos0 commented 3 years ago

Hey!

Your goreleaser config is setting Version (capital V) instead of version... probably that's the issue...

matryer commented 3 years ago

@caarlos0 Thanks for your help. That's it, the variable is unexported in main and they don't match.

matryer commented 3 years ago

Verified, this is fixed. Thanks everyone.

➜  moq_0.2.1_macOS_x86_64 ./moq -version
moq version 0.2.1