All skills
Skillintermediate

Go Security

> This file extends the common security rule with Go specific content.

Claude Code Knowledge Pack7/10/2026

Overview

Go Security

This file extends the common security rule with Go specific content.

Secret Management

apiKey := os.Getenv("OPENAI_API_KEY")
if apiKey == "" {
    log.Fatal("OPENAI_API_KEY not configured")
}

Security Scanning

  • Use gosec for static security analysis:
    gosec ./...
    

Context & Timeouts

Always use context.Context for timeout control:

ctx, cancel := context.WithTimeout(ctx, 5*time.Second)
defer cancel()