https://github.com/andrewstuart/buildmeta
https://github.com/andrewstuart/buildmeta
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/andrewstuart/buildmeta
- Owner: andrewstuart
- License: mit
- Created: 2021-11-22T15:04:20.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2023-03-10T18:31:08.000Z (over 3 years ago)
- Last Synced: 2025-02-03T06:41:56.048Z (over 1 year ago)
- Language: Go
- Size: 41 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Buildmeta
An easy way to set `ldflags` and retain build-time metadata that is useful for
Go applications running in any environment.
## Getting Started
There are already a few applications out there with canonical paths for build
metadata, though none thus far is authoritative. This package takes the idea and
extends it to include a CLI that knows how to set ldflags appropriately so that
all your build needs is `-ldflags "$(buildmeta ldflags)"`. There are additional
options for outputting JSON metadata for e.g. static directories.
To use this, run `go install github.com/andrewstuart/buildmeta/cmd/buildmeta@latest` in
terminal, and run `buildmeta` to validate output. You can also try `go run
github.com/andrewstuart/buildmeta/cmd/buildmeta` which will both download and run this module.
```bash
go build -o app -ldflags "$(buildmeta ldflags)"
```