Skip to content

Commit b038579

Browse files
committed
fix var name typo
1 parent 3c5b358 commit b038579

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

pkg/log/zap/zap.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,10 @@ func UseDevMode(enabled bool) Opts {
5656
}
5757

5858
// WriteTo configures the logger to write to the given io.Writer, instead of standard error.
59-
// See Options.DestWritter
59+
// See Options.DesWriter
6060
func WriteTo(out io.Writer) Opts {
6161
return func(o *Options) {
62-
o.DestWritter = out
62+
o.DesWriter = out
6363
}
6464
}
6565

@@ -143,9 +143,9 @@ type Options struct {
143143
// NewEncoder configures Encoder using the provided EncoderConfigOptions.
144144
// Note that the NewEncoder function is not used when the Encoder option is already set.
145145
NewEncoder NewEncoderFunc
146-
// DestWritter controls the destination of the log output. Defaults to
146+
// DestWriter controls the destination of the log output. Defaults to
147147
// os.Stderr.
148-
DestWritter io.Writer
148+
DesWriter io.Writer
149149
// Level configures the verbosity of the logging. Defaults to Debug when
150150
// Development is true and Info otherwise
151151
Level zapcore.LevelEnabler
@@ -160,8 +160,8 @@ type Options struct {
160160

161161
// addDefaults adds defaults to the Options
162162
func (o *Options) addDefaults() {
163-
if o.DestWritter == nil {
164-
o.DestWritter = os.Stderr
163+
if o.DesWriter == nil {
164+
o.DesWriter = os.Stderr
165165
}
166166

167167
if o.Development {
@@ -216,7 +216,7 @@ func NewRaw(opts ...Opts) *zap.Logger {
216216
o.addDefaults()
217217

218218
// this basically mimics New<type>Config, but with a custom sink
219-
sink := zapcore.AddSync(o.DestWritter)
219+
sink := zapcore.AddSync(o.DesWriter)
220220

221221
o.ZapOpts = append(o.ZapOpts, zap.AddCallerSkip(1), zap.ErrorOutput(sink))
222222
log := zap.New(zapcore.NewCore(&KubeAwareEncoder{Encoder: o.Encoder, Verbose: o.Development}, sink, o.Level))

pkg/log/zap/zap_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ var _ = Describe("Zap options setup", func() {
137137
It("should set a custom writer", func() {
138138
var w fakeSyncWriter
139139
WriteTo(&w)(opts)
140-
Expect(opts.DestWritter).To(Equal(&w))
140+
Expect(opts.DesWriter).To(Equal(&w))
141141
})
142142
})
143143

0 commit comments

Comments
 (0)