mirror of
https://github.com/spf13/viper
synced 2024-12-23 20:17:03 +00:00
reword
This commit is contained in:
parent
2cf56962a6
commit
da44dc1a84
1 changed files with 2 additions and 3 deletions
|
@ -103,14 +103,13 @@ if err != nil { // Handle errors reading the config file
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
Alternatively (or in addition), the path to a specific config file,
|
Alternatively (or in addition), the path to a specific config file can be provided (instead of a directory).
|
||||||
rather than to a directory containing config files, can be provided.
|
|
||||||
|
|
||||||
```go
|
```go
|
||||||
viper.SetConfigFile("$HOME/customconfig.toml") // explicitly add a specific config file
|
viper.SetConfigFile("$HOME/customconfig.toml") // explicitly add a specific config file
|
||||||
err := viper.ReadInConfig() // read the config file
|
err := viper.ReadInConfig() // read the config file
|
||||||
if err != nil { // Handle errors reading the config file
|
if err != nil { // Handle errors reading the config file
|
||||||
panic(fmt.Errorf("Fatal error config file: %s \n", err))
|
panic(fmt.Errorf("Fatal error while loading config file: %s \n", err))
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue