SSLMate / certspotter

Certificate Transparency Log Monitor
https://sslmate.com/certspotter
Mozilla Public License 2.0
962 stars 83 forks source link

certspotterVersion: also allow -X=main.Version #68

Closed paravoid closed 1 year ago

paravoid commented 1 year ago

debug.ReadBuildInfo() doesn't work for the Debian package, where there is no git repository (at best; could be the Debian packaging one). The go module doesn't have a version either.

Add a quick shortcut at the top, that sets the version to main.Version if it's non-empty -- which is by default, so no change in behavior.

Effectively, this allows one to use the standard -ldflags=-X=main.Version to set the version, like we intend to do in the Debian package.

AGWA commented 1 year ago

Thanks @paravoid! I've cherry-picked this, and tweaked it to append a ? to indicate that it might not match what the sumdb thinks the version is. I just released v0.15.1 with this and the typo fixes.