SetUseFilter returns a context having (re)set the "use filter" flag
(ctx context.Context, useFilter bool)
| 737 | |
| 738 | // SetUseFilter returns a context having (re)set the "use filter" flag |
| 739 | func SetUseFilter(ctx context.Context, useFilter bool) context.Context { |
| 740 | if useFilter == GetUseFilter(ctx) { |
| 741 | return ctx // Minimize depth of nested contexts |
| 742 | } |
| 743 | pVal := new(bool) |
| 744 | *pVal = useFilter |
| 745 | return context.WithValue(ctx, useFlagContextKey, pVal) |
| 746 | } |
| 747 | |
| 748 | // Reload the filters from the flags |
| 749 | func Reload(ctx context.Context) (err error) { |
searching dependent graphs…