Fix docs using wrong function name
This commit is contained in:
parent
5a57c51ec6
commit
849910d35b
1 changed files with 5 additions and 5 deletions
10
cfger.go
10
cfger.go
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue