{"id":13471726,"url":"https://github.com/ahmetb/govvv","last_synced_at":"2025-04-13T00:48:32.507Z","repository":{"id":57480374,"uuid":"64796638","full_name":"ahmetb/govvv","owner":"ahmetb","description":"\"go build\" wrapper to add version info to Golang applications","archived":false,"fork":false,"pushed_at":"2023-03-24T16:51:49.000Z","size":68,"stargazers_count":538,"open_issues_count":1,"forks_count":40,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-04-13T00:48:27.100Z","etag":null,"topics":["go","versioning"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ahmetb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2016-08-02T22:30:23.000Z","updated_at":"2025-03-11T16:44:23.000Z","dependencies_parsed_at":"2023-07-13T19:31:53.497Z","dependency_job_id":null,"html_url":"https://github.com/ahmetb/govvv","commit_stats":null,"previous_names":["ahmetalpbalkan/govvv"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahmetb%2Fgovvv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahmetb%2Fgovvv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahmetb%2Fgovvv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahmetb%2Fgovvv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ahmetb","download_url":"https://codeload.github.com/ahmetb/govvv/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248650437,"owners_count":21139672,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["go","versioning"],"created_at":"2024-07-31T16:00:48.729Z","updated_at":"2025-04-13T00:48:32.483Z","avatar_url":"https://github.com/ahmetb.png","language":"Go","funding_links":[],"categories":["Go","DevOps Tools","Go Tools"],"sub_categories":["DevOps Tools"],"readme":"# govvv\n\nThe simple Go binary versioning tool that wraps the `go build` command. \n\n\u003e :warning::warning::warning: **DEPRECATED:** Go now offers [build info](https://pkg.go.dev/runtime/debug#BuildInfo) natively. Please migrate to use that instead. I am no longer planning to maintain this project.\n\n![](https://cl.ly/0U2m441v392Q/intro-1.gif)\n\nStop worrying about `-ldflags` and **`go get github.com/ahmetb/govvv`** now.\n\n## Build Variables\n\n| Variable | Description | Example |\n|----------|-------------|---------|\n| **`main.GitCommit`** | short commit hash of source tree | `0b5ed7a` |\n| **`main.GitBranch`** | current branch name the code is built off | `master` |\n| **`main.GitState`** | whether there are uncommitted changes | `clean` or `dirty` | \n| **`main.GitSummary`** | output of `git describe --tags --dirty --always` | `v1.0.0`, \u003cbr/\u003e`v1.0.1-5-g585c78f-dirty`, \u003cbr/\u003e `fbd157c` |\n| **`main.BuildDate`** | RFC3339 formatted UTC date | `2016-08-04T18:07:54Z` |\n| **`main.Version`** | contents of `./VERSION` file, if exists, or the value passed via the `-version` option | `2.0.0` |\n\n## Using govvv is easy\n\nJust add the build variables you want to the `main` package and run:\n\n| old          | :sparkles: new :sparkles: |\n| -------------|-----------------|\n| `go build`   | `govvv build`   |\n| `go install` | `govvv install` | \n\n## Version your app with govvv\n\nCreate a `VERSION` file in your build root directory and add a `Version`\nvariable to your `main` package.\n\n![](https://cl.ly/3Q1K1R2D3b2K/intro-2.gif)\n\nDo you have your own way of specifying `Version`? No problem:\n\n## govvv lets you specify custom `-ldflags`\n\nYour existing `-ldflags` argument will still be preserved:\n\n    govvv build -ldflags \"-X main.BuildNumber=$buildnum\" myapp\n\nand the `-ldflags` constructed by govvv will be appended to your flag.\n\n## Don’t want to depend on `govvv`? It’s fine!\n\nYou can just pass a `-print` argument and `govvv` will just print the\n`go build` command with `-ldflags` for you and will not execute the go tool:\n\n    $ govvv build -print\n    go build \\\n\t    -ldflags \\\n\t    \"-X main.GitCommit=57b9870 -X main.GitBranch=dry-run -X main.GitState=dirty -X main.Version=0.1.0 -X main.BuildDate=2016-08-08T20:50:21Z\"\n\nStill don’t want to wrap the `go` tool? Well, try `-flags` to retrieve the LDFLAGS govvv prepares:\n\n    $ go build -ldflags=\"$(govvv -flags)\"\n\n## Want to use a different package?\n\nYou can pass a `-pkg` argument with the full package name, and `govvv` will \nset the build variables in that package instead of `main`.  For example:\n\n```\n# build with govvv\n$ govvv build -pkg github.com/myacct/myproj/mypkg\n\n# build with go\n$ go build -ldflags=\"$(govvv -flags -pkg $(go list ./mypkg))\"\n```\n## Want to use a different version?\n\nYou can pass a `-version` argument with the desired version, and `govvv` will \nuse the specified version instead of obtaining it from the `./VERSION` file.\nFor example:\n\n```\n# build with govvv\n$ govvv build -version 1.2.3\n\n# build with go\n$ go build -ldflags=\"$(govvv -flags -version 1.2.3)\"\n```\n\n## Try govvv today\n\n    $ go get github.com/ahmetb/govvv\n\n------\n\ngovvv is distributed under [Apache 2.0 License](LICENSE).\n\nCopyright 2016 Ahmet Alp Balkan \n\n------\n\n[![Build Status](https://travis-ci.org/ahmetb/govvv.svg?branch=master)](https://travis-ci.org/ahmetb/govvv)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fahmetb%2Fgovvv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fahmetb%2Fgovvv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fahmetb%2Fgovvv/lists"}