Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,9 @@ if err != nil {
You can handle the specific case where no config file is found.

```go
var fileLookupError viper.FileLookupError
var configFileErr viper.ConfigFileNotFoundError
if err := viper.ReadInConfig(); err != nil {
if errors.As(err, &fileLookupError) {
if errors.As(err, &configFileErr) {
// Indicates an explicitly set config file is not found (such as with
// using `viper.SetConfigFile`) or that no config file was found in
// any search path (such as when using `viper.AddConfigPath`)
Expand Down