Skip to content

ticatwolves/go-project-skeleton

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🦴 Go Project Template: Skeleton for Modern Modules

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)

Dependencies

This template, uses the following

⚡️ Quick Start: Using This Skeleton

Follow these steps to create a new project from this template:

1. Clone and Initialize

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"

2. Setup Local Hooks

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.

🚀 Automated Release Workflow

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 Best Practices

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.

📜 License

This project is licensed under the MIT License.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages