Skip to content

Commit

Permalink
use defer
Browse files Browse the repository at this point in the history
  • Loading branch information
amolmejari2 committed Jul 12, 2023
1 parent f2bb36e commit 27ac60d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion runtime/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -567,8 +567,8 @@ func WithSafeLogFields(ctx context.Context) context.Context {

func (sf *safeLogFields) append(fields []zap.Field) {
sf.mu.Lock()
defer sf.mu.Unlock()
sf.fields = append(sf.fields, fields...)
sf.mu.Unlock()
}

func (sf *safeLogFields) getFields() []zap.Field {
Expand Down

0 comments on commit 27ac60d

Please sign in to comment.