1
0
mirror of https://github.com/astaxie/beego.git synced 2025-06-12 08:20:39 +00:00

gofmt -s -w .

This commit is contained in:
astaxie
2016-08-17 22:49:30 +08:00
parent bed1d9bd27
commit 68311b286e
6 changed files with 11 additions and 13 deletions

View File

@ -25,4 +25,4 @@ type ansiColorWriter struct {
func (cw *ansiColorWriter) Write(p []byte) (int, error) {
return cw.w.Write(p)
}
}

View File

@ -25,7 +25,7 @@ import (
)
type (
csiState int
csiState int
parseResult int
)
@ -294,7 +294,7 @@ func changeColor(param []byte) parseResult {
case ansiBlinkOff:
winAttr.backgroundIntensity = 0
default:
// unknown code
// unknown code
}
case c.drawType == foreground:
winAttr.foregroundColor = c.code
@ -420,9 +420,9 @@ func (cw *ansiColorWriter) Write(p []byte) (int, error) {
}
if cw.mode != DiscardNonColorEscSeq || cw.state == outsideCsiCode {
nw, err = cw.w.Write(p[first:len(p)])
nw, err = cw.w.Write(p[first:])
r += nw
}
return r, err
}
}

View File

@ -291,4 +291,4 @@ func TestIgnoreUnknownSequences(t *testing.T) {
if actualTail != expectedTail {
t.Errorf("Get %q, want %q", actualTail, expectedTail)
}
}
}

View File

@ -95,9 +95,7 @@ func formatTimeHeader(when time.Time) ([]byte, int) {
//len("2006/01/02 15:04:05 ")==20
var buf [20]byte
//change to '3' after 984 years, LOL
buf[0] = y1[y/1000%10]
//change to '1' after 84 years, LOL
buf[1] = y2[y/100]
buf[2] = y3[y-y/100*100]
buf[3] = y4[y-y/100*100]