https://github.com/gregoryv/stamp
Generates build information from standardized git repositories
https://github.com/gregoryv/stamp
go golang
Last synced: about 1 year ago
JSON representation
Generates build information from standardized git repositories
- Host: GitHub
- URL: https://github.com/gregoryv/stamp
- Owner: gregoryv
- License: bsd-3-clause
- Created: 2017-11-08T13:38:39.000Z (over 8 years ago)
- Default Branch: main
- Last Pushed: 2020-10-22T02:34:24.000Z (over 5 years ago)
- Last Synced: 2025-02-05T07:19:39.407Z (over 1 year ago)
- Topics: go, golang
- Language: Go
- Size: 49.8 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: changelog.go
- License: LICENSE
Awesome Lists containing this project
README
[](https://travis-ci.org/gregoryv/stamp)
[](https://codecov.io/gh/gregoryv/stamp)
[](https://codeclimate.com/github/gregoryv/stamp/maintainability)
[stamp](https://godoc.org/github.com/gregoryv/stamp) - Parses out build information to embed into your binary
Normalize how version and build information makes it's way into your binaries.
Generates code that can be used to add flags
-v Print version and exit
-vv
Print version with details and exit
## Quick start
Install
go get github.com/gregoryv/stamp/...
Example main.go
//go:generate stamp -go build_stamp.go -clfile changelog.md
package main
import (
"github.com/gregoryv/stamp"
"flag"
)
func main() {
stamp.InitFlags() // Defines -v and -vv flags
flag.Parse()
stamp.AsFlagged()
//...
}
Then generate with
go generate .
go build .
## Details
stamp depends on git and that you have a CHANGELOG.md. The changelog is parsed for the latest
released version and assumes it follows http://keepachangelog.com/en/1.0.0/ format.