Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tonglil/versioning
A library to make set/get/writing versioning information easier
https://github.com/tonglil/versioning
cli go golang library open-source version versioning versions
Last synced: 9 days ago
JSON representation
A library to make set/get/writing versioning information easier
- Host: GitHub
- URL: https://github.com/tonglil/versioning
- Owner: tonglil
- License: mit
- Created: 2017-02-05T08:32:21.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-02-28T01:19:41.000Z (over 7 years ago)
- Last Synced: 2024-06-19T05:44:17.278Z (5 months ago)
- Topics: cli, go, golang, library, open-source, version, versioning, versions
- Language: Go
- Size: 2.93 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Versioning
A library to make set/get/writing versioning information easier.
## Installation
Use `go get`:
```
go get -u github.com/tonglil/versioning
```## Usage
1. Add in `main.go`:
```go
var version stringfunc init() {
versioning.Set(version)
}
```1. Where you want to get the version:
```go
version := versioning.Get()
// or
versioning.Write(os.Stdout)
```1. Build your binary with this flag:
```bash
go build -ldflags "-X main.version=123-up-to-you"
```## Development
Roadmap:
- Checking new versions
- Possibly use semver: https://github.com/hashicorp/go-version or https://github.com/blang/semver
- Self-upgrading binary