From ffd20492d19f547de3456249ed374ba752c2e1ab Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Mon, 22 Jan 2024 08:07:58 -0800 Subject: 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. --- internal/version/main.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 internal/version/main.go (limited to 'internal/version') 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)" +} -- cgit v1.2.3