Skip to content

Commit fd178ad

Browse files
committed
*: Return nil instead of an empty struct
1 parent ae164cd commit fd178ad

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

example/memcached-operator/handler.go.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ func RegisterOperatorMetrics() (*Metrics, error) {
173173
})
174174
err := prometheus.Register(operatorErrors)
175175
if err != nil {
176-
return &Metrics{}, err
176+
return nil, err
177177
}
178178
return &Metrics{operatorErrors: operatorErrors}, nil
179179
}

pkg/generator/generator_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ func RegisterOperatorMetrics() (*Metrics, error) {
166166
})
167167
err := prometheus.Register(operatorErrors)
168168
if err != nil {
169-
return &Metrics{}, err
169+
return nil, err
170170
}
171171
return &Metrics{operatorErrors: operatorErrors}, nil
172172
}

pkg/generator/templates.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ func RegisterOperatorMetrics() (*Metrics, error) {
262262
})
263263
err := prometheus.Register(operatorErrors)
264264
if err != nil {
265-
return &Metrics{}, err
265+
return nil, err
266266
}
267267
return &Metrics{operatorErrors: operatorErrors}, nil
268268
}

0 commit comments

Comments
 (0)