From 68311b286e8b83ec77297237a8f297953dbef48a Mon Sep 17 00:00:00 2001 From: astaxie Date: Wed, 17 Aug 2016 22:49:30 +0800 Subject: [PATCH] gofmt -s -w . --- httplib/httplib.go | 8 ++++---- logs/color.go | 2 +- logs/color_windows.go | 8 ++++---- logs/color_windows_test.go | 2 +- logs/logger.go | 2 -- orm/orm_test.go | 2 +- 6 files changed, 11 insertions(+), 13 deletions(-) diff --git a/httplib/httplib.go b/httplib/httplib.go index 505bb45b..7e6f2700 100644 --- a/httplib/httplib.go +++ b/httplib/httplib.go @@ -409,10 +409,10 @@ func (b *BeegoHTTPRequest) DoRequest() (*http.Response, error) { if trans == nil { // create default transport trans = &http.Transport{ - TLSClientConfig: b.setting.TLSClientConfig, - Proxy: b.setting.Proxy, - Dial: TimeoutDialer(b.setting.ConnectTimeout, b.setting.ReadWriteTimeout), - MaxIdleConnsPerHost: -1, + TLSClientConfig: b.setting.TLSClientConfig, + Proxy: b.setting.Proxy, + Dial: TimeoutDialer(b.setting.ConnectTimeout, b.setting.ReadWriteTimeout), + MaxIdleConnsPerHost: -1, } } else { // if b.transport is *http.Transport then set the settings. diff --git a/logs/color.go b/logs/color.go index fb21b42e..41d23638 100644 --- a/logs/color.go +++ b/logs/color.go @@ -25,4 +25,4 @@ type ansiColorWriter struct { func (cw *ansiColorWriter) Write(p []byte) (int, error) { return cw.w.Write(p) -} \ No newline at end of file +} diff --git a/logs/color_windows.go b/logs/color_windows.go index 47f7b24e..deee4c87 100644 --- a/logs/color_windows.go +++ b/logs/color_windows.go @@ -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 -} \ No newline at end of file +} diff --git a/logs/color_windows_test.go b/logs/color_windows_test.go index d87d9798..5074841a 100644 --- a/logs/color_windows_test.go +++ b/logs/color_windows_test.go @@ -291,4 +291,4 @@ func TestIgnoreUnknownSequences(t *testing.T) { if actualTail != expectedTail { t.Errorf("Get %q, want %q", actualTail, expectedTail) } -} \ No newline at end of file +} diff --git a/logs/logger.go b/logs/logger.go index 1d480c07..e0abfdc4 100644 --- a/logs/logger.go +++ b/logs/logger.go @@ -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] diff --git a/orm/orm_test.go b/orm/orm_test.go index 1410fd8a..75a60cb0 100644 --- a/orm/orm_test.go +++ b/orm/orm_test.go @@ -2062,7 +2062,7 @@ func TestIntegerPk(t *testing.T) { throwFail(t, AssertIs(out.Value, intPk.Value)) } - num, err = dORM.InsertMulti(1, []*IntegerPk{&IntegerPk{ + num, err = dORM.InsertMulti(1, []*IntegerPk{{ ID: 1, Value: "ok", }}) throwFail(t, err)