{"id":13432517,"url":"https://github.com/thockin/go-build-template","last_synced_at":"2025-04-09T03:12:22.344Z","repository":{"id":37686673,"uuid":"68775600","full_name":"thockin/go-build-template","owner":"thockin","description":"A Makefile/Dockerfile example for Go projects.","archived":false,"fork":false,"pushed_at":"2024-04-19T14:48:42.000Z","size":665,"stargazers_count":3185,"open_issues_count":4,"forks_count":430,"subscribers_count":54,"default_branch":"master","last_synced_at":"2024-04-20T14:49:53.422Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Makefile","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/thockin.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":"2016-09-21T03:16:57.000Z","updated_at":"2024-06-20T17:31:08.812Z","dependencies_parsed_at":"2023-10-12T06:56:49.389Z","dependency_job_id":"b8b6a130-be95-4406-869e-8c8807117167","html_url":"https://github.com/thockin/go-build-template","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thockin%2Fgo-build-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thockin%2Fgo-build-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thockin%2Fgo-build-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thockin%2Fgo-build-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thockin","download_url":"https://codeload.github.com/thockin/go-build-template/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247968373,"owners_count":21025823,"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":[],"created_at":"2024-07-31T02:01:12.697Z","updated_at":"2025-04-09T03:12:22.328Z","avatar_url":"https://github.com/thockin.png","language":"Makefile","funding_links":[],"categories":["Makefile"],"sub_categories":[],"readme":"# Go app template build environment\n\nThis is a skeleton project for a Go application, which captures the best build\ntechniques I have learned to date.  It uses a Makefile to drive the build (the\nuniversal API to software projects) and a Dockerfile to build a docker image.\n\nThis has only been tested on Linux, and depends on Docker buildx to build.\n\n## Customizing it\n\nTo use this, simply copy this repo and make the following changes:\n\nMakefile:\n   - change `BINS` to your binary name(s)\n   - replace `cmd/myapp-*` with one directory for each of your `BINS`\n   - change `REGISTRY` to the Docker registry you want to use\n   - choose a strategy for `VERSION` values - git tags or manual\n   - maybe change `ALL_PLATFORMS`\n   - maybe change `BASE_IMAGE` (it must be a manifest-list with support for all\n     platforms in `ALL_PLATFORMS`)\n\nDockerfile.in:\n   - maybe change or remove the `USER` if you need\n\ngo.mod:\n   - change module name to the one you want to use\n\n## Go Modules\n\nThis assumes the use of go modules (which is the default for all Go builds\nas of Go 1.13).\n\n## Dependencies\n\nThis includes go-licenses and golangci-lint, but they are kept in the `tools`\nsub-module.  If you don't want those (or their dependencies, they can be\nremoved.\n\n## Building\n\nRun `make` or `make build` to compile your app.  This will use docker buildx\n(which you need to have installed) to build your app, with the current\ndirectory volume-mounted into place.  This will store incremental state for the\nfastest possible build.  Run `make all-build` to build for all architectures.\n\nRun `make container` to build the container image.  It will calculate the image\ntag based on the most recent git tag, and whether the repo is \"dirty\" since\nthat tag (see `make version`).  Run `make all-container` to build containers\nfor all supported architectures.\n\nRun `make push` to push the container image to `REGISTRY`.  Run `make all-push`\nto push the container images for all architectures.\n\nRun `make manifest-list` to build and push all containers for all\narchitectures, and then publish a manifest-list for them.\n\nRun `make clean` to clean up.\n\nRun `make help` to get a list of available targets.\n\n## Testing\n\nRun `make test` and `make lint` to run tests and linters, respectively.  Like\nbuilding, this will use docker to execute.\n\nThe golangci-lint tool looks for configuration in `.golangci.yaml`.  If that\nfile is not provided, it will use its own built-in defaults.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthockin%2Fgo-build-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthockin%2Fgo-build-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthockin%2Fgo-build-template/lists"}