{"id":20430930,"url":"https://github.com/xwi88/version","last_synced_at":"2026-05-09T08:02:15.937Z","repository":{"id":100984303,"uuid":"260681152","full_name":"xwi88/version","owner":"xwi88","description":"add the version info for your program with go build","archived":false,"fork":false,"pushed_at":"2020-05-25T04:04:30.000Z","size":3,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"release","last_synced_at":"2025-03-05T05:44:14.852Z","etag":null,"topics":["api-version","build-version","build-versioning","goversion","version"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xwi88.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-05-02T12:20:54.000Z","updated_at":"2020-05-25T03:53:28.000Z","dependencies_parsed_at":null,"dependency_job_id":"5dfb4bac-bae6-46dd-9fa0-a56620c807ef","html_url":"https://github.com/xwi88/version","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/xwi88/version","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xwi88%2Fversion","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xwi88%2Fversion/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xwi88%2Fversion/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xwi88%2Fversion/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xwi88","download_url":"https://codeload.github.com/xwi88/version/tar.gz/refs/heads/release","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xwi88%2Fversion/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32811662,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-08T08:22:46.396Z","status":"online","status_checked_at":"2026-05-09T02:00:06.633Z","response_time":123,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["api-version","build-version","build-versioning","goversion","version"],"created_at":"2024-11-15T08:09:38.914Z","updated_at":"2026-05-09T08:02:15.919Z","avatar_url":"https://github.com/xwi88.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# version\ngo build with version \n\n## usage\n\n```makefile\n# Makefile to build the command lines and tests in this project.\n# This Makefile doesn't consider Windows Environment. If you use it in Windows, please be careful.\n\nSHELL := /bin/bash\n\n#BASEDIR = $(shell pwd)\nBASEDIR = $(dir $(realpath $(firstword $(MAKEFILE_LIST))))\n\n# add following lines before go build!\nversionDir = github.com/xwi88/version\n\ngitBranch = $(shell git symbolic-ref --short -q HEAD)\n\nifeq ($(gitBranch),)\ngitTag = $(shell git describe --always --tags --abbrev=0)\nendif\n\nbuildTime = $(shell date \"+%FT%T%z\")\ngitCommit = $(shell git rev-parse HEAD)\ngitTreeState = $(shell if git status|grep -q 'clean';then echo clean; else echo dirty; fi)\n\n# -ldflags flags accept a space-separated list of arguments to pass to an underlying tool during the build.\nldflags=\"-X ${versionDir}.gitBranch=${gitBranch} -X ${versionDir}.gitTag=${gitTag} \\\n -X ${versionDir}.buildTime=${buildTime} -X ${versionDir}.gitCommit=${gitCommit} \\\n -X ${versionDir}.gitTreeState=${gitTreeState}\"\n\n```\n\n`go build -ldflags ${ldflags} `\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxwi88%2Fversion","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxwi88%2Fversion","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxwi88%2Fversion/lists"}