This repository is a minimal, opinionated template designed to bootstrap a new Go module. It is pre-configured with industry-standard tooling for code quality, automated testing, and release management.
The value of this skeleton lies in its pre-configured files:
.pre-commit-config.yaml
.github/workflows/go.yml
.config/goreleaser.yaml
go.mod
(ready for renaming)
This template, uses the following
- Conventional commits
- Github Actions
- GoReleaser
- Semantic Versioning
- pre commit hooks, pre commit GoLang, pre commit gitleaks
Follow these steps to create a new project from this template:
Replace github.com/YOUR_USER_NAME/YOUR_PROJECT_NAME with your actual module path.
# 1. Clone the template
git clone [https://github.com/ticatwolves/go-project-skeleton.git](https://github.com/ticatwolves/go-project-skeleton.git) your-new-project-name
cd your-new-project-name
# 2. Delete the template's git history
rm -rf .git
# 3. Initialize your new module path
go mod init [github.com/YOUR_USER_NAME/YOUR_PROJECT_NAME](https://github.com/YOUR_USER_NAME/YOUR_PROJECT_NAME)
# 4. Start tracking your new repository
git init
git add .
git commit -m "feat: Initial commit from Go skeleton template"
We use the pre-commit
framework to enforce code style locally before committing.
# Install framework (requires Python/pip)
pip install pre-commit
# Install hooks into your local git repository
pre-commit install
The hooks automatically run gofmt, go vet, and golangci-lint. Configuration details are in .pre-commit-config.yaml.
This template uses Semantic Versioning (SemVer) and GitHub Actions to automate publishing.
Commit Changes: Commit all your new features/fixes.
Tag the Version: Push a tag to trigger the release workflow.
# Example: Creating a new minor version tag
git tag v1.1.0
git push origin v1.1.0
This action automatically publishes the module to pkg.go.dev
and creates a GitHub Release.
Documentation is generated by godoc directly from source code comments and is visible on pkg.go.dev.
-
Rule: The doc comment must immediately precede the declaration, and the first sentence must start with the identifier.
-
Package Overview: Create a doc.go file in the package root for a high-level description.
-
Runnable Examples: Create ExampleFunc() functions in your _test.go files to demonstrate usage.
This project is licensed under the MIT License.