You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am just starting a new Go project (a hobby project, GPLv3+, on gitlab, for some sort of wiki thing). I am using Linux/Debian/Sid with Go 1.11.1 and I don't care about non-Linux systems (so portability to Windows is not a concern).
I really want to have a small .go file generated at every build. That file just defines two strings (one for the build timestamp, one for its git commit).
This StackOverflow question describes what I have in mind. I would like to generate at every build some timestamp.go file having something similar to
// generated timestamp.go file
package timestamp
var Buildtime = "Tue 30 Oct 2018 09:39:01 AM MET";
var Buildlastgitcommit = "7fde394b60bc adding timestamp.go"
The Buildtime string is obtained by date +%c. The Buildlastcommit string is obtained by a few git commands.
Is godel the right tool for this? I cannot easily find in the documentation of godel how generated .go files are managed.
The text was updated successfully, but these errors were encountered:
I am just starting a new Go project (a hobby project, GPLv3+, on gitlab, for some sort of wiki thing). I am using Linux/Debian/Sid with Go 1.11.1 and I don't care about non-Linux systems (so portability to Windows is not a concern).
I really want to have a small .go file generated at every build. That file just defines two strings (one for the build timestamp, one for its git commit).
This StackOverflow question describes what I have in mind. I would like to generate at every build some
timestamp.go
file having something similar toThe
Buildtime
string is obtained bydate +%c
. TheBuildlastcommit
string is obtained by a fewgit
commands.Is godel the right tool for this? I cannot easily find in the documentation of godel how generated .go files are managed.
The text was updated successfully, but these errors were encountered: