Skip to content
This repository has been archived by the owner on Mar 14, 2023. It is now read-only.

Commit

Permalink
Fix go lint warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Evgeniy Kulikov committed Oct 10, 2019
1 parent 1dbb29e commit aec7ca2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
1 change: 1 addition & 0 deletions codec/encoder.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ func (w *encResponseWriter) Write(data []byte) (int, error) {
return w.enc.Encode(w.ResponseWriter).Write(data)
}

//NewEncodedResponse returns http.ResponseWriter, that writes with Encoder
func NewEncodedResponse(w http.ResponseWriter, enc Encoder) http.ResponseWriter {
return &encResponseWriter{
ResponseWriter: w,
Expand Down
20 changes: 14 additions & 6 deletions rpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,28 @@ type (
replyType reflect.Type // type of the response argument
}

//Error is constant error
Error string

// CompressionSelector alias
CompressionSelector = codec.CompressionSelector
)

const (
ErrNotAFunction = Error("method must be function")
ErrNotEnoughArgs = Error("method needs three args: *http.Request, *args, *reply")
ErrNotEnoughOut = Error("method needs one out: error")
ErrNotReturnError = Error("method needs one out: error")
//ErrNotAFunction when passed not a function
ErrNotAFunction = Error("method must be function")
//ErrNotEnoughArgs when passed less than three args
ErrNotEnoughArgs = Error("method needs three args: *http.Request, *args, *reply")
//ErrNotEnoughOut when method has not output
ErrNotEnoughOut = Error("method needs one out: error")
//ErrNotReturnError when method out is not error
ErrNotReturnError = Error("method needs one out: error")
//ErrFirstArgRequest when first arg is not *http.Request
ErrFirstArgRequest = Error("method needs first parameter to be *http.Request")
ErrSecondArgError = Error("second argument must be a pointer and must be exported")
ErrThirdArgError = Error("third argument must be a pointer and must be exported")
//ErrSecondArgError when 2nd arg is not pointer or not exported
ErrSecondArgError = Error("second argument must be a pointer and must be exported")
//ErrThirdArgError when 3rd arf is not pointer or not exported
ErrThirdArgError = Error("third argument must be a pointer and must be exported")
)

var (
Expand Down

0 comments on commit aec7ca2

Please sign in to comment.