friendsofgo / killgrave

Simple way to generate mock servers written in Go

Home Page:https://friendsofgo.github.io/killgrave/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Improve the way to get the Version

aperezg opened this issue · comments

Context

Today if you run Killgrave with a compiled version and you use the flag version you will get the last version that you have installed on your system. But if you want to compile Killgrave by your own or using go get command you will get dev.

This is happens because we are using the ldflags to configure the version when we build the realease version.

Proposed implementation

We need a easy way to store the version of the application and getting when the user use the flag version, although the version was compiled by the own user.

commented

I'd like to take this. Could you assign the issue to me? Will create PR in the next 48 hours. If no PR by then, feel free to unassign

ok @andyyaldoo go for it :)

@aperezg Can I take this up?

I was thinking of the following approach :-
we can use the output of git describe as version and update the Makefile to include build.

Seems that could be a good approach, but if we want the users can use the versions on his own compilations like, go get we can't use the Makefile right?

But if you want to try to do a solution, go for it 💪 , remember using the branch v0.5.0 to do the modifications

Finally the we will follow the approach that @A9u commented, but instead to do it into the code, we do in the momment of the compilation so in this way, you could be able to moving the binary when its already compiled, adding some information on the README to the users follow the instruction to compile the code by theirself

So thanks for the collaboration :)