All Contributors

GitHub release Go Report Card

curver is a simple way to display the version of a CUI tool made with go.
curver was named as an abbreviation for current version.


go get


import (


Visit the docs on GoDoc


If the value using ldflag is stored in the variable Version, that value will be displayed.
Otherwise, it will display the build information embedded in the running binary.

use go build

package main

import (

func main () {
$ go build -ldflags '-X' -o ./main

This will display the following format.

$ ./main
version: v0.1.0

If you want to embed the result of ‘git tag’, you can do the following

$ go build -ldflags "-X$(git describe --tags)" -o ./main

use goreleaser

If you are using goreleaser to do the release, do the following

  - eldflags:
      - -s -w -X{{.Version}}

If you only want the version

The following will return the version as a string.

package main

import (

func main () {
    version := curver.GetVersion()


Copyright (c) 2022 harakeishi
Licensed under MIT

Contributors ✨

Thanks goes to these wonderful people (emoji key):

原 慧士


This project follows the all-contributors specification. Contributions of any kind welcome!


View Github