{"id":17355160,"url":"https://github.com/zephinzer/goinit","last_synced_at":"2026-01-06T18:04:43.650Z","repository":{"id":79926645,"uuid":"157060279","full_name":"zephinzer/goinit","owner":"zephinzer","description":"WIP","archived":false,"fork":false,"pushed_at":"2018-11-19T04:47:24.000Z","size":7142,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-01T18:27:10.775Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zephinzer.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":"2018-11-11T08:17:09.000Z","updated_at":"2018-11-19T04:47:26.000Z","dependencies_parsed_at":null,"dependency_job_id":"c963f9f1-b321-4058-8959-dffbb45efded","html_url":"https://github.com/zephinzer/goinit","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zephinzer%2Fgoinit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zephinzer%2Fgoinit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zephinzer%2Fgoinit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zephinzer%2Fgoinit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zephinzer","download_url":"https://codeload.github.com/zephinzer/goinit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245858880,"owners_count":20684062,"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-10-15T17:42:31.041Z","updated_at":"2026-01-06T18:04:43.642Z","avatar_url":"https://github.com/zephinzer.png","language":"Makefile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GoInit\nAn opionated Makefile based Golang project initializer.\n\n```\n$$$$$$\\            $$$$$$\\           $$\\   $$\\      \n$$  __$$\\           \\_$$  _|          \\__|  $$ |    \n$$ /  \\__| $$$$$$\\    $$ |  $$$$$$$\\  $$\\ $$$$$$\\   \n$$ |$$$$\\ $$  __$$\\   $$ |  $$  __$$\\ $$ |\\_$$  _|  \n$$ |\\_$$ |$$ /  $$ |  $$ |  $$ |  $$ |$$ |  $$ |    \n$$ |  $$ |$$ |  $$ |  $$ |  $$ |  $$ |$$ |  $$ |$$\\ \n\\$$$$$$  |\\$$$$$$  |$$$$$$\\ $$ |  $$ |$$ |  \\$$$$  |\n \\______/  \\______/ \\______|\\__|  \\__|\\__|   \\____/ \n```\n\n# Get Started\n\n## Option 1: You have Go\nRun the following:\n\n```\ngo get -v -d github.com/zephinzer/goinit\n```\n\nThen in any directory you can run `goinit` and a Makefile will appear. Run `make init` and you're good to go.\n\nTo uninstall, run:\n\n```sh\nrm -rf $(go env | grep GOPATH | cut -f 2 -d '=' | sed -e 's|\"||g')/src/github.com/zephinzer/goinit;\nrm -rf $(go env | grep GOPATH | cut -f 2 -d '=' | sed -e 's|\"||g')/bin/goinit;\n```\n\n## Option 2: You don't have Go and want a binary\nGo to [the Releases tab](https://github.com/zephinzer/goinit/releases), download a zip of the latest release and:\n\n1. Unzip it.\n1. In the `./bin` directory, copy the relevant binary out and move it to `/opt`.\n1. Create a symlink of the binary (`ln -s /opt/goinit-linux-amd64 /usr/local/bin/goinit`)\n1. Make the symlink executable (`chmod 550 /usr/local/bin/goinit`)\n\n\u003e Change `/usr/local/bin/goinit` to anywhere you deem fit.\n\n\n## Option 3: You don't have Go and don't want a binary\nYes, I know binaries can be scary. You can make your own script out of the following to get the `Makefile` which `goinit` provisions:\n\n```sh\ncurl -s -o \"$(pwd)/Makefile\" 'https://raw.githubusercontent.com/zephinzer/goinit/master/Makefile';\n```\n\nFrom the same directory you are in, run `make init`.\n\n# Scope and Principles and Usage\n\n## Monocommand Setup\nIt's tough enough to code, here's a single command to set up this initializer.\n\nRun: `goinit` in an empty directory. The latest self-contained `Makefile` should appear.\n\n## Develop Anywhere\nI don't know about you but I dislike having all (even unrelated) Go projects at `$GOPATH`. Using containers allows us to write our code anywhere and this initializer works as such.\n\nRun: `make init` in the directory you ran `goinit` in.\n\n## Container-Ready\nThe environment generated using `goinit` accounts for both development and production within containers so that we don't touch your native system's Go. This reduces occurrences of *\"it works on my machine\"* and keeps your `$GOPATH` pristine. Heck, you don't even need Go installed on your system!\n\nTo build your application: `make build`\n\nTo build the production container: `make build.docker.production`\n\n## Local Dependencies\nRelated to writing your Go application anywhere you deem fit (instead of where `$GOPATH` deems fit), this initializer uses `dep` to manage a local set of dependencies in a `vendor` directory. A `src` directory is symlinked to it so that code editors such as VSCode can use their spidey Intellisenses.\n\nTo initialise dependencies: `make dep.init` or `make mod.init`\n\nTo update dependencies: `make dep.ensure` or `make mod.download`\n\nTo run an arbitrary `dep` command: `make dep ARGS=\"whatever\"`\n\n## Quick Feedback\nFast feedback cycles allow us to iterate quicker. In development, code is live-reloaded as it is saved, same goes for tests.\n\n- [Gin by @codegangsta](https://github.com/codegangsta/gin) is used for live-reloading of your application.\n- A handy `auto-run.py` script by GoConvey is used for watching test files.\n\nTo start development, create a `main.go` and run `make start`\n\nFor libraries, create a `something.go` and a `something_test.go` and run `make test.watch`\n\n## Pipeline Ready\nContinuous integration/delivery is all part of the Agile hype - albeit a well-justified hype.\n\nTo run tests with coverage, run: `make test`\n\n## Semver Versioning\nThis initializers enables easy bumping of patch, minor, and major versions. Good enough for smaller projects that just need to get up and going quickly.\n\nTo get the latest version, run: `make version.get`\n\nTo bump the PATCH version, run: `make version.bump`\n\nTo bump the MINOR version, run: `make version.bump.minor`\n\nTo bump the MAJOR version, run: `make version.bump.major`\n\n# Motiviation\nI'm by day a DevOps engineer and by night a Go newbie. In my efforts to learn Go, I decided to make setting up of a project as system-independent as possible so that I can do work on both my Mac and my Ubuntu. This should work on Windows too but it's not within my interest to support that. Contribute if it's broken/you wish!\n\n# Contribution\n- The `./src` directory contains all files which will be used in the Makefile.\n- These files are copied into the Makefile on build and pushed to this repository.\n- After modifying the scripts or Dockerfile, use the `./.make.sh` script to update the main `Makefile`.\n- Then run `make build` to create the binaries.\n- Push it to your fork and create a pull request.\n\n# License\nCode for this initializer is licensed under the MIT license. See [LICENSE for the full text](./LICENSE).\n\n# ChangeLog\n## 0.3.0\n- Added support for `go mod` via the `mod.*` Makefile recipe\n- Added capability to change the verison of Golang/Alpine through the Makefile using `--build-arg` (add it yourself if needed)\n\n## 0.2.0\n- Earliest recorded version\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzephinzer%2Fgoinit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzephinzer%2Fgoinit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzephinzer%2Fgoinit/lists"}