We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 438695e commit 2c876d2Copy full SHA for 2c876d2
docs/v3/examples/flags.md
@@ -501,7 +501,9 @@ getting data from a yaml file below.
501
502
```go
503
// --- >8 ---
504
- command.Before = altsrc.InitInputSourceWithContext(command.Flags, NewYamlSourceFromFlagFunc("load"))
+ command.Before = func(ctx context.Context, cmd *Command) (context.Context, error) {
505
+ return ctx, altsrc.InitInputSourceWithContext(command.Flags, NewYamlSourceFromFlagFunc("load"))
506
+ }
507
```
508
509
The code above will use the "load" string as a flag name to get the file name of
0 commit comments