Fix hook sample in README.md.
Update `debugFlag` in hook code listing to be `type` rather than `var` so that the code listing compiles.
This commit is contained in:
@@ -230,7 +230,7 @@ eg.
|
|||||||
|
|
||||||
```go
|
```go
|
||||||
// A flag with a hook that, if triggered, will set the debug loggers output to stdout.
|
// A flag with a hook that, if triggered, will set the debug loggers output to stdout.
|
||||||
var debugFlag bool
|
type debugFlag bool
|
||||||
|
|
||||||
func (d debugFlag) BeforeApply(logger *log.Logger) error {
|
func (d debugFlag) BeforeApply(logger *log.Logger) error {
|
||||||
logger.SetOutput(os.Stdout)
|
logger.SetOutput(os.Stdout)
|
||||||
|
|||||||
Reference in New Issue
Block a user