Languages
Go .gitignore
.gitignore for languages projects
.gitignore Content
# ============================================================================
# Created by https://gitignores.com/
# LANGUAGE-SPECIFIC TEMPLATE for Go
# Website: https://golang.org/
# Repository: https://github.com/golang/go
# ============================================================================
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
# TEMPLATE OVERVIEW & USAGE NOTES
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
# • TEMPLATE TYPE: LANGUAGE-SPECIFIC TEMPLATE
# • PURPOSE: Go language patterns for compiled binaries, dependency modules, and test artifacts
# • DESIGN PHILOSOPHY: Modular design for combination with common templates
# • COMBINATION GUIDANCE: Combine with common templates for comprehensive coverage
# • SECURITY CONSIDERATIONS: Does not include security patterns - combine with common/security.gitignore
# • BEST PRACTICES: Combine with common/security.gitignore, review patterns, test with your setup
# • OFFICIAL SOURCES: Go documentation and community best practices
# ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
# BUILD ARTIFACTS & DISTRIBUTION PACKAGES
# ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
# Go compiled binaries and distribution artifacts
*.exe
*.exe~
# ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
# DEPENDENCY MANAGEMENT & PACKAGE CACHE
# ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
go-build/
GoBuild/
vendor/
# ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
# DEVELOPMENT & RUNTIME ARTIFACTS
# ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
.testcache/
go/pkg/mod/cache/
# ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
# LANGUAGE-SPECIFIC PATTERNS
# ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
*.coverprofile
*.test
bin/
pkg/
profile.out
# ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
# TESTING & QUALITY ASSURANCE ARTIFACTS
# ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
coverage.html
coverage.txt
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
# TEMPLATE CUSTOMIZATION & BEST PRACTICES
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
# 1. REVIEW: Examine all patterns before use
# 2. CUSTOMIZE: Adapt to your project's specific structure
# 3. TEST: Use `git check-ignore` to verify patterns work correctly
# 4. SECURE: Always protect sensitive data and credentials
# 5. UPDATE: Review periodically as technology evolves
# For comprehensive coverage, consider combining with:
# - Framework template if applicable (frameworks/*.gitignore)
# - Common security patterns (common/security.gitignore) - CRITICAL for protecting sensitive data
# - Common cache patterns (common/cache.gitignore)
# - Common build patterns (common/build.gitignore)
# - Common logs patterns (common/logs.gitignore)
# - IDE template for your editor (ides/*.gitignore)
# - OS template for your system (os/*.gitignore)
# EXAMPLE COMBINATION FOR Go:
# cat languages/go.gitignore \
# common/security.gitignore \
# common/cache.gitignore \
# common/build.gitignore \
# common/logs.gitignore \
# ides/visual-studio-code.gitignore \
# os/macos.gitignore \
# os/windows.gitignore > .gitignore