/go-vbuild

A Go subcommand extender that adds -ldflags -X variables to go build and go install.

Primary LanguageGoGNU General Public License v3.0GPL-3.0

go-vbuild

A Go subcommand extender that adds -ldflags -X variables to go build and go install.

reportcard build godoc License: GPL v3

It runs:

go (build|install) [args...] -ldflags \
  -X github.com/gomatic/go-vbuild.Who=${USER} \
  -X github.com/gomatic/go-vbuild.Where=${HOST} \
  -X github.com/gomatic/go-vbuild.Patch=$(git show -s --format=%ct)-$(git log --pretty=format:'%h' -n 1)

Example

See cmds/go-versioning

Installation

⚠️ This installs ${GOBIN}/go-build, ${GOBIN}/go-install. These are intended to be executed by extender to override the go build and go install commands.

go get github.com/gomatic/go-vbuild