Note Get* behavior on parse failure

Even though it's kind of evident as these functions don't return an
error, it can still come as a surprise.
This commit is contained in:
Ville Skyttä 2023-11-21 09:31:45 +02:00 committed by Márk Sági-Kazár
parent a4a551fd2a
commit 4c9b2a26ae

View file

@ -565,6 +565,9 @@ One important thing to recognize is that each Get function will return a zero
value if its not found. To check if a given key exists, the `IsSet()` method
has been provided.
The zero value will also be returned if the value is set, but fails to parse
as the requested type.
Example:
```go
viper.GetString("logfile") // case-insensitive Setting & Getting