Skip to content

Commit 9700a52

Browse files
committed
Remove direct dependency on pflag
We weren't actually using pflag, except as an interface assertion. This makes it more obvious that pflag isn't actually used.
1 parent 7437900 commit 9700a52

File tree

3 files changed

+3
-11
lines changed

3 files changed

+3
-11
lines changed

go.mod

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ require (
1414
github.com/onsi/gomega v1.8.1
1515
github.com/prometheus/client_golang v1.0.0
1616
github.com/prometheus/client_model v0.2.0
17-
github.com/spf13/pflag v1.0.5
18-
go.uber.org/atomic v1.4.0 // indirect
1917
go.uber.org/zap v1.10.0
2018
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4
2119
gomodules.xyz/jsonpatch/v2 v2.0.1

go.sum

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,8 +319,6 @@ go.mongodb.org/mongo-driver v1.1.2/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qL
319319
go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
320320
go.uber.org/atomic v1.3.2 h1:2Oa65PReHzfn29GpvgsYwloV9AVFHPDk8tYxt2c2tr4=
321321
go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
322-
go.uber.org/atomic v1.4.0 h1:cxzIVoETapQEqDhQu3QfnvXAV4AlzcvUCxkVUFw3+EU=
323-
go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
324322
go.uber.org/multierr v1.1.0 h1:HoEmRHQPVSqub6w2z2d2EOVs2fjyFRGyofhKuyDq0QI=
325323
go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0=
326324
go.uber.org/zap v1.10.0 h1:ORx85nbTijNz8ljznvCMR1ZBIPKFn3jQrag10X2AsuM=

pkg/log/zap/flags.go

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,13 @@ import (
2323
"strconv"
2424
"strings"
2525

26-
"github.com/spf13/pflag"
2726
"go.uber.org/zap"
2827
"go.uber.org/zap/zapcore"
2928
)
3029

30+
// each of these flags also should implement the flag.Value, as well
31+
// as pflag.Value for convinience.
32+
3133
var levelStrings = map[string]zapcore.Level{
3234
"debug": zap.DebugLevel,
3335
"-1": zap.DebugLevel,
@@ -46,8 +48,6 @@ type encoderFlag struct {
4648
value string
4749
}
4850

49-
var _ pflag.Value = &encoderFlag{}
50-
5151
func (ev *encoderFlag) String() string {
5252
return ev.value
5353
}
@@ -85,8 +85,6 @@ type levelFlag struct {
8585
value string
8686
}
8787

88-
var _ pflag.Value = &levelFlag{}
89-
9088
func (ev *levelFlag) Set(flagValue string) error {
9189
level, validLevel := levelStrings[strings.ToLower(flagValue)]
9290
if !validLevel {
@@ -119,8 +117,6 @@ type stackTraceFlag struct {
119117
value string
120118
}
121119

122-
var _ pflag.Value = &stackTraceFlag{}
123-
124120
func (ev *stackTraceFlag) Set(flagValue string) error {
125121
level, validLevel := levelStrings[strings.ToLower(flagValue)]
126122
if !validLevel {

0 commit comments

Comments
 (0)