Go .gitignore Template
Go compiled binaries, test artifacts, and workspace configuration. Generated and merged deterministically with upstream GitHub repository patterns to keep your repository clean of package directories, temporary build artifacts, and local environment files.
Interactive Stack Generator
Open in Full GeneratorGo compiled binaries, test artifacts, and workspace configuration
### Go #### If you prefer the allow list template instead of the deny list, see community template:# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore## Binaries for programs and plugins*.exe*.exe~*.dll*.so*.dylib # Test binary, built with `go test -c`*.test # Code coverage profiles and other test artifacts*.outcoverage.**.coverprofileprofile.cov # Dependency directories (remove the comment below to include it)# vendor/ # Go workspace filego.workgo.work.sum # env file.env # Editor/IDE# .idea/# .vscode/ Raw Go .gitignore
Crawlable upstream source template# If you prefer the allow list template instead of the deny list, see community template:# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore## Binaries for programs and plugins*.exe*.exe~*.dll*.so*.dylib # Test binary, built with `go test -c`*.test # Code coverage profiles and other test artifacts*.outcoverage.**.coverprofileprofile.cov # Dependency directories (remove the comment below to include it)# vendor/ # Go workspace filego.workgo.work.sum # env file.env # Editor/IDE# .idea/# .vscode/ Key Pattern Breakdown
Build & Compilation Artifacts
Ignores compiled binaries, intermediate object files, and build output directories generated during development.
Environment & Secrets
Prevents leaking sensitive local credentials, API keys, database URLs, and environment configuration files.
Cache & Temporary Files
Ignores compiler caches, test runner coverage data, and transient temporary scratch files.
Source & Verification
Place this file in the root directory of your project as .gitignore. Changes take effect on newly added or untracked files.