about summary refs log tree commit diff
path: root/internal/version/main.go
diff options
context:
space:
mode:
authorFranck Cuny <franck@fcuny.net>2024-01-22 08:07:58 -0800
committerFranck Cuny <franck@fcuny.net>2024-01-22 08:07:58 -0800
commitffd20492d19f547de3456249ed374ba752c2e1ab (patch)
tree90f587e26e77dfd28147e830fa0d87bf7ade28dd /internal/version/main.go
parentdisable linter for yaml (diff)
downloadworld-ffd20492d19f547de3456249ed374ba752c2e1ab.tar.gz
build all the binaries using a Makefile
Add a Makefile to build the local binaries. Rename all the commands
without a dash.

We can build the commands with `make all` or by being explicit, for
example `make bin/x509-info`.

Add a common package to keep track of build information (commit and
build date) so we can reuse the same pattern across all the commands.
Diffstat (limited to 'internal/version/main.go')
-rw-r--r--internal/version/main.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/internal/version/main.go b/internal/version/main.go
new file mode 100644
index 0000000..d8a745f
--- /dev/null
+++ b/internal/version/main.go
@@ -0,0 +1,12 @@
+package version
+
+import "fmt"
+
+var Version, BuildDate string
+
+func VersionAndBuildInfo() string {
+	if Version != "" {
+		return fmt.Sprintf("version: %s, build on: %s", Version, BuildDate)
+	}
+	return "(unknown)"
+}