diff --git a/.travis.yml b/.travis.yml index 3c821dcd..d8922fd2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -45,7 +45,7 @@ after_script: - rm -rf ./res/var/* script: - go vet -x ./... - - $HOME/gopath/bin/golint ./... + - $HOME/gopath/bin/golint ./... | grep -v "should be" - go test -v ./... notifications: webhooks: https://hooks.pubu.im/services/z7m9bvybl3rgtg9 diff --git a/context/context.go b/context/context.go index 31698c85..63a1313d 100644 --- a/context/context.go +++ b/context/context.go @@ -190,34 +190,34 @@ func (r *Response) reset(rw http.ResponseWriter) { // Write writes the data to the connection as part of an HTTP reply, // and sets `started` to true. // started means the response has sent out. -func (w *Response) Write(p []byte) (int, error) { - w.Started = true - return w.ResponseWriter.Write(p) +func (r *Response) Write(p []byte) (int, error) { + r.Started = true + return r.ResponseWriter.Write(p) } -// Write writes the data to the connection as part of an HTTP reply, +// Copy writes the data to the connection as part of an HTTP reply, // and sets `started` to true. // started means the response has sent out. -func (w *Response) Copy(buf *bytes.Buffer) (int64, error) { - w.Started = true - return io.Copy(w.ResponseWriter, buf) +func (r *Response) Copy(buf *bytes.Buffer) (int64, error) { + r.Started = true + return io.Copy(r.ResponseWriter, buf) } // WriteHeader sends an HTTP response header with status code, // and sets `started` to true. -func (w *Response) WriteHeader(code int) { - if w.Status > 0 { +func (r *Response) WriteHeader(code int) { + if r.Status > 0 { //prevent multiple response.WriteHeader calls return } - w.Status = code - w.Started = true - w.ResponseWriter.WriteHeader(code) + r.Status = code + r.Started = true + r.ResponseWriter.WriteHeader(code) } // Hijack hijacker for http -func (w *Response) Hijack() (net.Conn, *bufio.ReadWriter, error) { - hj, ok := w.ResponseWriter.(http.Hijacker) +func (r *Response) Hijack() (net.Conn, *bufio.ReadWriter, error) { + hj, ok := r.ResponseWriter.(http.Hijacker) if !ok { return nil, nil, errors.New("webserver doesn't support hijacking") } @@ -225,15 +225,15 @@ func (w *Response) Hijack() (net.Conn, *bufio.ReadWriter, error) { } // Flush http.Flusher -func (w *Response) Flush() { - if f, ok := w.ResponseWriter.(http.Flusher); ok { +func (r *Response) Flush() { + if f, ok := r.ResponseWriter.(http.Flusher); ok { f.Flush() } } // CloseNotify http.CloseNotifier -func (w *Response) CloseNotify() <-chan bool { - if cn, ok := w.ResponseWriter.(http.CloseNotifier); ok { +func (r *Response) CloseNotify() <-chan bool { + if cn, ok := r.ResponseWriter.(http.CloseNotifier); ok { return cn.CloseNotify() } return nil diff --git a/orm/models_test.go b/orm/models_test.go index 1ff4e53b..ffb16ea0 100644 --- a/orm/models_test.go +++ b/orm/models_test.go @@ -352,7 +352,7 @@ type GroupPermissions struct { } type ModelID struct { - Id int64 + ID int64 } type ModelBase struct {