diff options
author | Luke Shumaker <lukeshu@lukeshu.com> | 2023-03-31 18:01:47 -0600 |
---|---|---|
committer | Luke Shumaker <lukeshu@lukeshu.com> | 2023-04-04 14:08:38 -0600 |
commit | c1578391cc2089cd224fd8325c333038e0ba7b7b (patch) | |
tree | eb003ba90cb0f8b1863167dec670b4ef0f80f29a /lib/textui/log.go | |
parent | 1ba83231195ea3b78ce545f4518f70c74819345b (diff) |
maps: Add HasKey and HaveAnyKeysInCommon functions, use them
Diffstat (limited to 'lib/textui/log.go')
-rw-r--r-- | lib/textui/log.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/textui/log.go b/lib/textui/log.go index e8325c2..e5d3f60 100644 --- a/lib/textui/log.go +++ b/lib/textui/log.go @@ -26,6 +26,8 @@ import ( "git.lukeshu.com/go/typedsync" "github.com/datawire/dlib/dlog" "github.com/spf13/pflag" + + "git.lukeshu.com/btrfs-progs-ng/lib/maps" ) type LogLevelFlag struct { @@ -201,7 +203,7 @@ func (l *logger) log(lvl dlog.LogLevel, writeMsg func(io.Writer)) { fields := make(map[string]any) var fieldKeys []string for f := l; f.parent != nil; f = f.parent { - if _, exists := fields[f.fieldKey]; exists { + if maps.HasKey(fields, f.fieldKey) { continue } fields[f.fieldKey] = f.fieldVal |