fix golint issues in formatters

This commit is contained in:
dmathieu
2017-07-26 14:26:30 +02:00
parent 3114d6f617
commit 325575f181
3 changed files with 11 additions and 4 deletions
+3 -1
View File
@@ -26,6 +26,7 @@ func init() {
baseTimestamp = time.Now()
}
// TextFormatter formats logs into text
type TextFormatter struct {
// Set to true to bypass checking for a TTY before outputting colors.
ForceColors bool
@@ -64,6 +65,7 @@ func (f *TextFormatter) init(entry *Entry) {
}
}
// Format renders a single log entry
func (f *TextFormatter) Format(entry *Entry) ([]byte, error) {
var b *bytes.Buffer
keys := make([]string, 0, len(entry.Data))
@@ -88,7 +90,7 @@ func (f *TextFormatter) Format(entry *Entry) ([]byte, error) {
timestampFormat := f.TimestampFormat
if timestampFormat == "" {
timestampFormat = DefaultTimestampFormat
timestampFormat = defaultTimestampFormat
}
if isColored {
f.printColored(b, entry, keys, timestampFormat)