https://github.com/gomatic/go-vbuild
A Go subcommand extender that adds -ldflags -X variables to go build and go install.
https://github.com/gomatic/go-vbuild
extender extension golang toolchain
Last synced: about 1 year ago
JSON representation
A Go subcommand extender that adds -ldflags -X variables to go build and go install.
- Host: GitHub
- URL: https://github.com/gomatic/go-vbuild
- Owner: gomatic
- License: gpl-3.0
- Created: 2017-04-23T19:32:25.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-05-07T14:53:13.000Z (about 9 years ago)
- Last Synced: 2025-03-25T07:01:56.897Z (over 1 year ago)
- Topics: extender, extension, golang, toolchain
- Language: Go
- Homepage:
- Size: 22.5 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go-vbuild
A Go subcommand [extender](//github.com/gomatic/extender) that adds `-ldflags -X` variables to
`go build` and `go install`.
[](https://goreportcard.com/report/github.com/gomatic/go-vbuild)
[](https://travis-ci.org/gomatic/go-vbuild)
[](https://godoc.org/github.com/gomatic/go-vbuild)
[](http://www.gnu.org/licenses/gpl-3.0)
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](cmds/go-versioning/main.go)
# Installation
:warning: This installs `${GOBIN}/go-build`, `${GOBIN}/go-install`. These are intended to be
executed by [extender](//github.com/gomatic/extender) to override the
`go build` and `go install` commands.
go get github.com/gomatic/go-vbuild