13-gitVersion

command
v0.0.0-...-039cffb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 31, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

 User should run:
 # To retrieve the latest commit hash
	export VERSION=$(git rev-list -1 HEAD)
	# Following command is used to build a Go program with custom values set for variables at compile time
	go build -ldflags "-X main.VERSION=$VERSION" gitVersion.go

	In one line:
	export VERSION=$(git rev-list -1 HEAD) && go build -ldflags "-X main.VERSION=$VERSION" gitVersion.go                                                                                                                  │

	After that, program can be run using:
	./gitVersion version
	And the output will be the version hash for the new program.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL