diff --git a/README.md b/README.md index f48ebb790..8b6a89899 100644 --- a/README.md +++ b/README.md @@ -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`)