Fix docs using wrong function name

This commit is contained in:
akp 2024-06-18 21:27:04 +01:00
parent 5a57c51ec6
commit 849910d35b
No known key found for this signature in database
GPG key ID: CF8D58F3DEB20755

View file

@ -55,8 +55,8 @@ var indexedPartRegexp = regexp.MustCompile(`(?m)([a-zA-Z]+)(?:\[(\d+)\])?`)
// Within a key representation, a dot represents a recursion into a named
// object and square brackets represent an index in a named array. You could access the value "hello" using the key `alpha[0].beta` in the below example.
//
// alpha:
// - beta: "hello"
// alpha:
// - beta: "hello"
func (cl *ConfigLoader) Get(key string) OptionalItem {
// httpcore[2].bananas
cl.lastKey = key
@ -89,7 +89,7 @@ func (cl *ConfigLoader) Get(key string) OptionalItem {
// Required gets a given key from the currently loaded configuration and raises
// a fatal error if it cannot be found.
//
//
// See documentation for Get for key format.
func (cl *ConfigLoader) Required(key string) OptionalItem {
opt := cl.Get(key)
@ -100,9 +100,9 @@ func (cl *ConfigLoader) Required(key string) OptionalItem {
return opt
}
// Required gets a given key from the currently loaded configuration and
// WithDefault gets a given key from the currently loaded configuration and
// returns a default value if it cannot be found.
//
//
// See documentation for Get for key format.
func (cl *ConfigLoader) WithDefault(key string, defaultValue any) OptionalItem {
opt := cl.Get(key)