Registry / config / spf13-viper

spf13-viper

JSON →
library1.21.0gogounverified

Package viper is a complete configuration solution for Go applications, supporting multiple config formats and environment variables.

go get github.com/spf13/viper
INSTALL
IMPORT
SIG · SPF13-VIPER
S
spf13-viper
configgov1.21.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

viper
github.com/spf13/viper

Read a config file named 'config.yaml' from the current directory and retrieve a value.

import "github.com/spf13/viper" viper.SetConfigName("config") viper.AddConfigPath(".") viper.ReadInConfig() fmt.Println("Port:", viper.GetInt("port"))
Debug
Known issues
gotchaViper's case-insensitive key matching can lead to unexpected behavior when keys differ only by case.
fix
Use consistent casing in config files and calls to Get.
affects: all
Upgrade
Version history
1.21.0latest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
55 hits · last 30 days
node
42
OpenAI (training)
1
Resources
spf13-viper — go get spf13-viper · libregistry