Affaan Mustafa 0e9f613fd1 Revert "feat(ecc): prune plugin 43→12 items, promote 7 rules to .claude/rules/ (#245)"
This reverts commit 1bd68ff534202ac2bf8c1eb264ea33a1302907a6.
2026-02-20 01:11:30 -08:00

490 B

Go 安全

此文件基于 common/security.md 扩展了 Go 特定内容。

密钥管理

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

安全扫描

  • 使用 gosec 进行静态安全分析:
    gosec ./...
    

上下文与超时

始终使用 context.Context 进行超时控制:

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