Golang configuration

From HoangNguyen0403/agent-skills-standard · View interactive version

Golang configuration is an AI agent skill from the GitHub repository HoangNguyen0403/agent-skills-standard. Load and validate application configuration from environment variables and config files. Use when managing Go application config with environment variables or viper.

How to use this skill

Skill file

Golang Configuration

**Priority: P1 (HIGH)**

Principles

Implementation Workflow

  1. Define Config struct — Create typed struct with all required fields.
  2. Load defaults — Set sensible defaults for non-secret values.
  3. Override from file — Optionally load from YAML/JSON config file.
  4. Override from env — Environment variables take highest priority.
  5. Validate at startup — Crash immediately on missing required config.
  6. Inject via constructor — Pass Config to services; never use global config vars.

See config struct and usage examples

Libraries

Anti-Patterns

References

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.