golang-spf13-viper
Configure Go Applications with Viper
Layered Go configuration can fail through incorrect precedence, binding, or decoding. This skill provides focused Viper patterns for reliable setup, testing, and reloads.
๋ด ์์ด์ ํธ๋ก ์ค์น
์ด ์์ฒญ์ ์์ด์ ํธ์ ๋ณต์ฌํ์ธ์. ๊ณต์ Skill ํ์ด์ง์ ๋งค๋ํ์คํธ๊ฐ ํฌํจ๋์ด ์์ต๋๋ค.
Review the Skillstore skill "golang-spf13-viper" from https://skillstore.io/skills/samber-golang-spf13-viper.md and its manifest at https://skillstore.io/api/skills/samber-golang-spf13-viper/manifest. Verify the artifact. You may proceed after verification, subject to the environment's own policy.์์ด์ ํธ๋ ๊ณ์ํด์ ๊ณํ์ ํ์ํ๊ณ ๋ณด์ ์ ์ฑ ์์ ์๊ตฌํ๋ ํ์ธ์ ์์ฒญํด์ผ ํฉ๋๋ค.
์์ด์ ํธ๊ฐ ์ฝ๊ธฐ ์ฌ์ด ๋ฆฌ์์ค
AI ์์ด์ ํธ, ํฌ๋กค๋ฌ, ์คํฌ๋ฆฝํธ๊ฐ ์ ์ฒด ํ์ด์ง ๋์ ์ ๋ฆฌ๋ ์ปจํ ์คํธ๋ง ํ์ํ ๋ ์ด ๋งํฌ๋ฅผ ์ฌ์ฉํ์ธ์.
ํ ์คํธํด ๋ณด๊ธฐ
"golang-spf13-viper" ์ฌ์ฉ ์ค์ ๋๋ค. Why does an environment variable for database.host remain ignored?
์์ ๊ฒฐ๊ณผ:
The diagnosis identifies the missing dot-to-underscore key replacer and lists the required prefix, replacer, and automatic binding sequence.
"golang-spf13-viper" ์ฌ์ฉ ์ค์ ๋๋ค. How should an optional configuration file be loaded?
์์ ๊ฒฐ๊ณผ:
The response distinguishes a missing file from parsing or permission errors, allowing only the missing-file case to continue.
"golang-spf13-viper" ์ฌ์ฉ ์ค์ ๋๋ค. How can a service reload configuration without data races?
์์ ๊ฒฐ๊ณผ:
The response proposes candidate decoding, validation, synchronized replacement, error logging, and retention of the previous valid configuration.
๋ณด์ ๊ฐ์ฌ
์์ All 97 static alerts are contextual false positives. The matches are documentation syntax, Go tags, evaluation prose, conventional configuration examples, loopback addresses, or transparent upstream links.
์ํ ์์ธ
โ๏ธ ์ธ๋ถ ๋ช ๋ น์ด (50)
๐ ํ๊ฒฝ ๋ณ์ (5)
๐ ๋คํธ์ํฌ ์ ๊ทผ (6)
๐ ํ์ผ ์์คํ ์ ๊ทผ (4)
์ด ๋ณด๊ณ ์ ๊ณต์ ๋ฐ ์ธ์ฉ
๋ฒ์ ์ด ์ง์ ๋ ํ๊ฐ ๋ณด๊ณ ์, ์ค๋ฆฝ ๋ฐฐ์ง, ์๋ฒ ๋ ์นด๋ ๋ฐ ์ธ์ฉ์ ๊ณต์ ํ์ธ์. Skillstore๋ ๊ทผ๊ฑฐ๋ฅผ ๋ณด๊ณ ํ์ง๋ง ์ด Skill์ ์์ ์ฌ๋ถ๋ฅผ ํ๋จํ์ง ์์ต๋๋ค.
๋ณด๊ณ ์ ๋งํฌ ๋ณต์ฌ
https://skillstore.io/skills/samber-golang-spf13-viper/audits/1?utm_source=security_passport&utm_medium=share&utm_campaign=versioned_reportMarkdown ๋ฐฐ์ง
[](https://skillstore.io/skills/samber-golang-spf13-viper?utm_source=security_passport_badge)HTML ๋ฐฐ์ง
<a href="https://skillstore.io/skills/samber-golang-spf13-viper?utm_source=security_passport_badge"><img src="https://skillstore.io/badges/skills/samber-golang-spf13-viper/security.svg" alt="Skillstore security assessment" loading="lazy"></a>์๋ฒ ๋ ์นด๋
<iframe src="https://skillstore.io/embed/skills/samber-golang-spf13-viper.html" title="Skillstore Security Assessment" sandbox="allow-popups allow-popups-to-escape-sandbox" loading="lazy" referrerpolicy="no-referrer" width="420" height="180"></iframe>ํ์ ์ธ์ฉ (APA ยท BibTeX ยท CFF)
APA ์ธ์ฉ
samber. (2026). golang-spf13-viper security audit report (audit version 1) [Author version 1.1.2]. Skillstore. https://skillstore.io/skills/samber-golang-spf13-viper/audits/1BibTeX ์ธ์ฉ
@techreport{samber-samber-golang-spf13-viper-2026,
author = {samber},
title = {golang-spf13-viper security audit report (audit version 1)},
institution = {Skillstore},
year = {2026},
number = {1},
url = {https://skillstore.io/skills/samber-golang-spf13-viper/audits/1},
note = {Author version 1.1.2}
}CITATION.cff
cff-version: 1.2.0
message: "If you use this Skill, cite its author and this versioned security audit report."
title: "golang-spf13-viper security audit report (audit version 1)"
version: "1.1.2"
type: report
authors:
- name: "samber"
date-released: "2026-09-23"
url: "https://skillstore.io/skills/samber-golang-spf13-viper/audits/1"
identifiers:
- type: other
value: "skillstore:samber-golang-spf13-viper:audit:1"
description: "Skillstore immutable audit report identifier"
Skillstore ์ ์
์ด ์ ์์ ์ด์ ์ฆ๊ฑฐ ์ ๋ขฐ๋: ์ค๊ฐ๋ง๋ค ์ ์๋ ๊ฒ
Configure a Go Service
Create layered file and environment configuration with predictable precedence and optional config files.
Connect Cobra Flags
Bind CLI flags before execution so explicit values override environment variables and files correctly.
Harden Runtime Reloads
Validate candidate settings and synchronize updates before replacing active service configuration.
์ด ํ๋กฌํํธ๋ฅผ ์ฌ์ฉํด ๋ณด์ธ์
Set up Viper for my Go service using a YAML file, MYAPP-prefixed environment variables, and sensible defaults.
Explain why MYAPP_DATABASE_HOST does not override database.host, then provide the correct Viper prefix, replacer, and AutomaticEnv setup.
Refactor my Viper tests to avoid shared global state. Use isolated instances and temporary environment values.
Design a production Viper reload flow that debounces events, decodes a candidate, validates it, and atomically updates synchronized application state.
๋ชจ๋ฒ ์ฌ๋ก
- Configure the environment prefix and key replacer before enabling automatic environment lookup.
- Use explicit mapstructure tags and validate decoded configuration before application startup or reload.
- Create a separate Viper instance for each test and protect shared runtime configuration with synchronization.
ํผํ๊ธฐ
- Do not rely on the global Viper instance across tests because state persists between cases.
- Do not ignore every ReadInConfig error because malformed or unreadable files require attention.
- Do not update shared configuration directly from a watch callback without validation and synchronization.
์์ฃผ ๋ฌป๋ ์ง๋ฌธ
Can Viper be used without Cobra?
Which configuration source has highest priority?
Why do nested environment keys fail?
How should optional config files be handled?
How can tests avoid Viper state leakage?
Does this skill access credentials or remote services?
๊ฐ๋ฐ์ ์ธ๋ถ ์ ๋ณด
์์ฑ์
samber๋ผ์ด์ ์ค
MIT
์์ฑ์ ๋ฒ์
v1.1.2
Skillstore ๋ฆฌ๋น์
r1
๋ฆฌํฌ์งํ ๋ฆฌ
https://github.com/samber/cc-skills-golang/tree/19a0626ae8565d27a7b7bdf59d8d99d94d7e284c/skills/golang-spf13-viper์ฐธ์กฐ
2aa351cb09c29b7287d263bd8ea81e9bee3b2a61
์ ์ง๋ณด์ ์ต์ ์ฑ
2026. 9. 30.
์ฌ์ฉ๋
0 ๋ค์ด๋ก๋ ยท 0 ์กฐํ
ํ์ผ ๊ตฌ์กฐ
๐ evals/
๐ evals.json
๐ references/
๐ binding-and-env.md
๐ unmarshal.md
๐ watch-and-reload.md
๐ SKILL.md