Skip to content

Commit 2c876d2

Browse files
committed
Update docs
1 parent 438695e commit 2c876d2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

docs/v3/examples/flags.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,9 @@ getting data from a yaml file below.
501501

502502
```go
503503
// --- >8 ---
504-
command.Before = altsrc.InitInputSourceWithContext(command.Flags, NewYamlSourceFromFlagFunc("load"))
504+
command.Before = func(ctx context.Context, cmd *Command) (context.Context, error) {
505+
return ctx, altsrc.InitInputSourceWithContext(command.Flags, NewYamlSourceFromFlagFunc("load"))
506+
}
505507
```
506508

507509
The code above will use the "load" string as a flag name to get the file name of

0 commit comments

Comments
 (0)