107 itself is not enough, adding git commit hash to version string could better help to solve a bug by quickly pinning down what snapshot of the codebase we are using.
How can it be fixed?
Implement feature like:
$ ./sharding-p2p-poc version
0.0.0 - 36daa4486d9e27ec2f068586d98ec928e419704c
This can be achieved by using the go build -ldflags feature to take commit hash string into a variable.
Go build would be replaced with
GIT_COMMIT=$(git rev-list -1 HEAD) && go build -ldflags "-X main.GitCommit=$GIT_COMMIT"
What is wrong?
107 itself is not enough, adding git commit hash to version string could better help to solve a bug by quickly pinning down what snapshot of the codebase we are using.
How can it be fixed?
go build -ldflags
feature to take commit hash string into a variable.go build
in docker.