Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
golint
  • Loading branch information
MakMukhi committed May 19, 2017
commit b10d475960bc5eca9a5d5d625886daf1c96ecffe
4 changes: 2 additions & 2 deletions rpc_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ func encode(c Codec, msg interface{}, cp Compressor, cbuf *bytes.Buffer, outPayl
// TODO(zhaoq): optimize to reduce memory alloc and copying.
b, err = c.Marshal(msg)
if err != nil {
return nil, Errorf(codes.Internal, "grpc: error while marshaling:", err.Error())
return nil, Errorf(codes.Internal, "grpc: error while marshaling: %v", err.Error())
}
if outPayload != nil {
outPayload.Payload = msg
Expand All @@ -299,7 +299,7 @@ func encode(c Codec, msg interface{}, cp Compressor, cbuf *bytes.Buffer, outPayl
}
if cp != nil {
if err := cp.Do(cbuf, b); err != nil {
return nil, Errorf(codes.Internal, "grpc: error while compressing:", err.Error())
return nil, Errorf(codes.Internal, "grpc: error while compressing: %v", err.Error())
}
b = cbuf.Bytes()
}
Expand Down
2 changes: 1 addition & 1 deletion server.go
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,7 @@ func (s *Server) sendResponse(t transport.ServerTransport, stream *transport.Str
}
p, err := encode(s.opts.codec, msg, cp, cbuf, outPayload)
if err != nil {
grpclog.Println("grpc: Server failed to encode response %v", err)
grpclog.Println("grpc: server failed to encode response: ", err)
return err
}
err = t.Write(stream, p, opts)
Expand Down
4 changes: 2 additions & 2 deletions test/end2end_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4128,11 +4128,11 @@ func (c *errCodec) Marshal(v interface{}) ([]byte, error) {
return nil, fmt.Errorf("3987^12 + 4365^12 = 4472^12")
}

func (p *errCodec) Unmarshal(data []byte, v interface{}) error {
func (c *errCodec) Unmarshal(data []byte, v interface{}) error {
return nil
}

func (p *errCodec) String() string {
func (c *errCodec) String() string {
return "proto"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return "near-misses"

}

Expand Down