Skip to content

Commit bfdce4c

Browse files
committed
log: SetFormat: include returns in switch
Signed-off-by: Sebastiaan van Stijn <[email protected]> (cherry picked from commit 40ee5fb) Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent 6621e08 commit bfdce4c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

log/context.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,15 +89,15 @@ func SetFormat(format string) error {
8989
TimestampFormat: RFC3339NanoFixed,
9090
FullTimestamp: true,
9191
})
92+
return nil
9293
case JSONFormat:
9394
logrus.SetFormatter(&logrus.JSONFormatter{
9495
TimestampFormat: RFC3339NanoFixed,
9596
})
97+
return nil
9698
default:
9799
return fmt.Errorf("unknown log format: %s", format)
98100
}
99-
100-
return nil
101101
}
102102

103103
// WithLogger returns a new context with the provided logger. Use in

0 commit comments

Comments
 (0)