mirror of
https://github.com/spf13/viper
synced 2025-05-15 00:27:18 +00:00
Update SetConfigType example
Seems it's always required.
This commit is contained in:
parent
7aafba0af0
commit
fc6736c260
1 changed files with 1 additions and 1 deletions
|
@ -113,7 +113,7 @@ where a configuration file is expected.
|
||||||
|
|
||||||
```go
|
```go
|
||||||
viper.SetConfigName("config") // name of config file (without extension)
|
viper.SetConfigName("config") // name of config file (without extension)
|
||||||
viper.SetConfigType("yaml") // REQUIRED if the config file has an extension
|
viper.SetConfigType("yaml") // REQUIRED
|
||||||
viper.AddConfigPath("/etc/appname/") // path to look for the config file in
|
viper.AddConfigPath("/etc/appname/") // path to look for the config file in
|
||||||
viper.AddConfigPath("$HOME/.appname") // call multiple times to add many search paths
|
viper.AddConfigPath("$HOME/.appname") // call multiple times to add many search paths
|
||||||
viper.AddConfigPath(".") // optionally look for config in the working directory
|
viper.AddConfigPath(".") // optionally look for config in the working directory
|
||||||
|
|
Loading…
Add table
Reference in a new issue