{"id":13413457,"url":"https://github.com/lacion/cookiecutter-golang","last_synced_at":"2026-01-18T04:53:02.209Z","repository":{"id":14663350,"uuid":"76799246","full_name":"lacion/cookiecutter-golang","owner":"lacion","description":"A Go project template","archived":false,"fork":false,"pushed_at":"2024-02-01T20:51:27.000Z","size":42,"stargazers_count":684,"open_issues_count":2,"forks_count":176,"subscribers_count":9,"default_branch":"main","last_synced_at":"2024-07-31T20:52:21.768Z","etag":null,"topics":["cookiecutter","cookiecutter-golang","golang","project-template"],"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/lacion.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","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":"AUTHORS.md","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-12-18T18:22:26.000Z","updated_at":"2024-07-22T15:47:27.000Z","dependencies_parsed_at":"2024-10-26T09:10:01.750Z","dependency_job_id":"c8be410e-0422-4486-b48a-548b6960a553","html_url":"https://github.com/lacion/cookiecutter-golang","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/lacion/cookiecutter-golang","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lacion%2Fcookiecutter-golang","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lacion%2Fcookiecutter-golang/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lacion%2Fcookiecutter-golang/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lacion%2Fcookiecutter-golang/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lacion","download_url":"https://codeload.github.com/lacion/cookiecutter-golang/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lacion%2Fcookiecutter-golang/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28530401,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-18T00:39:45.795Z","status":"online","status_checked_at":"2026-01-18T02:00:07.578Z","response_time":98,"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":["cookiecutter","cookiecutter-golang","golang","project-template"],"created_at":"2024-07-30T20:01:40.828Z","updated_at":"2026-01-18T04:53:02.188Z","avatar_url":"https://github.com/lacion.png","language":"Go","funding_links":[],"categories":["Go","HarmonyOS","Miscellaneous","Project Layout","杂项","Microsoft Office","其他杂项","others","Other Languages and Platforms"],"sub_categories":["Windows Manager","Project Layout","项目布局","项目结构","项目结构`用于构建项目的非官方模式集。`","Cookiecutter Templates"],"readme":"# cookiecutter-golang\n\n[![Build Status](https://travis-ci.org/lacion/cookiecutter-golang.svg?branch=master)](https://travis-ci.org/lacion/cookiecutter-golang)\n\nPowered by [Cookiecutter](https://github.com/audreyr/cookiecutter), Cookiecutter Golang is a framework for jumpstarting production-ready go projects quickly.\n\n## Features\n\n- Generous `Makefile` with management commands\n- Uses `go dep` (with optional go module support *requires go 1.11*)\n- injects build time and git hash at build time.\n\n## Optional Integrations\n\n- Can use [viper](https://github.com/spf13/viper) for env var config\n- Can use [cobra](https://github.com/spf13/cobra) for cli tools\n- Can use [logrus](https://github.com/sirupsen/logrus) for logging\n- Can create dockerfile for building go binary and dockerfile for final go binary (no code in final container)\n- If docker is used adds docker management commands to makefile\n- Option of TravisCI, CircleCI or None\n\n## Constraints\n\n- Uses `dep` or `mod` for dependency management\n- Only maintained 3rd party libraries are used.\n\nThis project now uses docker multistage builds, you need at least docker version v17.05.0-ce to use the docker file in this template, [you can read more about multistage builds here](https://www.critiqus.com/post/multi-stage-docker-builds/).\n\n## Docker\n\nThis template uses docker multistage builds to make images slimmer and containers only the final project binary and assets with no source code whatsoever.\n\nYou can find the image dokcer file in this [repo](https://github.com/lacion/alpine-golang-buildimage) and more information about docker multistage builds in this [blog post](https://www.critiqus.com/post/multi-stage-docker-builds/).\n\nApps run under non root user and also with [dumb-init](https://github.com/Yelp/dumb-init).\n\n## Usage\n\nLet's pretend you want to create a project called \"echoserver\". Rather than starting from scratch maybe copying \nsome files and then editing the results to include your name, email, and various configuration issues that always \nget forgotten until the worst possible moment, get cookiecutter to do all the work.\n\nFirst, get Cookiecutter. Trust me, it's awesome:\n```console\n$ pip install cookiecutter\n```\n\nAlternatively, you can install `cookiecutter` with homebrew:\n```console\n$ brew install cookiecutter\n```\n\nFinally, to run it based on this template, type:\n```console\n$ cookiecutter https://github.com/lacion/cookiecutter-golang.git\n```\n\nYou will be asked about your basic info (name, project name, app name, etc.). This info will be used to customize your new project.\n\nWarning: After this point, change 'Luis Morales', 'lacion', etc to your own information.\n\nAnswer the prompts with your own desired [options](). For example:\n```console\nfull_name [Luis Morales]: Luis Morales\ngithub_username [lacion]: lacion\napp_name [mygolangproject]: echoserver\nproject_short_description [A Golang project.]: Awesome Echo Server\ndocker_hub_username [lacion]: lacion\ndocker_image [lacion/docker-alpine:latest]: lacion/docker-alpine:latest\ndocker_build_image [lacion/docker-alpine:gobuildimage]: lacion/docker-alpine:gobuildimage\nuse_docker [y]: y\nuse_git [y]: y\nuse_logrus_logging [y]: y\nuse_viper_config [y]: y\nuse_cobra_cmd [y]: y\nSelect use_ci:\n1 - travis\n2 - circle\n3 - none\nChoose from 1, 2, 3 [1]: 1\n```\n\nEnter the project and take a look around:\n```console\n$ cd echoserver/\n$ ls\n```\n\nRun `make help` to see the available management commands, or just run `make build` to build your project.\n```console\n$ make help\n$ make build\n$ ./bin/echoserver\n```\n\n## Projects build with cookiecutter-golang\n\n- [iothub](https://github.com/lacion/iothub) websocket multiroom server for IoT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flacion%2Fcookiecutter-golang","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flacion%2Fcookiecutter-golang","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flacion%2Fcookiecutter-golang/lists"}