From 391f15a12d3723708f03fda1923732dfc60cce4a Mon Sep 17 00:00:00 2001 From: Arnaud Lemaire Date: Thu, 12 Nov 2015 14:04:13 +0100 Subject: [PATCH] fmt --- log/formatter.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/log/formatter.go b/log/formatter.go index 43c0d03a..ae99572c 100644 --- a/log/formatter.go +++ b/log/formatter.go @@ -50,7 +50,7 @@ func (f *BlaFormatter) Format(entry *log.Entry) ([]byte, error) { // isColored := isTerminal && (runtime.GOOS != "windows") - paths := strings.SplitN(file, "/", pathSkip + 1) + paths := strings.SplitN(file, "/", pathSkip+1) b := &bytes.Buffer{} fmt.Fprintf(b, "%s %s%-5s%s %s%30s:%-3d%s %s%-44s%s", @@ -81,15 +81,15 @@ func (f *BlaFormatter) reduceFilePath(path string, max int) string { split := strings.Split(path, "/") splitlen := len(split) reducedSize := len(path) - var buffer bytes.Buffer; + var buffer bytes.Buffer for i, e := range split { - if (reducedSize > max && i + 1 < splitlen) { + if reducedSize > max && i+1 < splitlen { buffer.WriteByte(e[0]) reducedSize -= len(e) - 1 } else { buffer.WriteString(e) } - if (i + 1 < splitlen) { + if i+1 < splitlen { buffer.WriteByte('/') } } @@ -99,7 +99,7 @@ func (f *BlaFormatter) reduceFilePath(path string, max int) string { func (f *BlaFormatter) findFileAndLine() (string, int) { var file string var line int - for i := 5;; i++ { + for i := 5; ; i++ { _, file, line, _ = runtime.Caller(i) if !strings.Contains(file, "Sirupsen/logrus") { break @@ -176,9 +176,9 @@ func (f *BlaFormatter) levelColor(level log.Level) string { func needsQuoting(text string) bool { for _, ch := range text { if !((ch >= 'a' && ch <= 'z') || - (ch >= 'A' && ch <= 'Z') || - (ch >= '0' && ch <= '9') || - ch == '-' || ch == '.') { + (ch >= 'A' && ch <= 'Z') || + (ch >= '0' && ch <= '9') || + ch == '-' || ch == '.') { return false } }