Fixing dead code and go vet moaning
This commit is contained in:
parent
3a10b1cdde
commit
5865e89bed
@ -172,7 +172,7 @@ func (g *grpcCodec) Write(m *codec.Message, v interface{}) error {
|
|||||||
return g.s.SendMsg(v)
|
return g.s.SendMsg(v)
|
||||||
}
|
}
|
||||||
// write the body using the framing codec
|
// write the body using the framing codec
|
||||||
return g.s.SendMsg(&bytes.Frame{m.Body})
|
return g.s.SendMsg(&bytes.Frame{Data: m.Body})
|
||||||
}
|
}
|
||||||
|
|
||||||
func (g *grpcCodec) Close() error {
|
func (g *grpcCodec) Close() error {
|
||||||
|
@ -60,7 +60,6 @@ func (j *jsonCodec) ReadHeader(m *codec.Message, mt codec.MessageType) error {
|
|||||||
default:
|
default:
|
||||||
return fmt.Errorf("Unrecognised message type: %v", mt)
|
return fmt.Errorf("Unrecognised message type: %v", mt)
|
||||||
}
|
}
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (j *jsonCodec) ReadBody(b interface{}) error {
|
func (j *jsonCodec) ReadBody(b interface{}) error {
|
||||||
|
@ -307,8 +307,6 @@ func (m *monitor) Stop() error {
|
|||||||
m.running = false
|
m.running = false
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func newMonitor(opts ...Option) Monitor {
|
func newMonitor(opts ...Option) Monitor {
|
||||||
|
@ -135,8 +135,6 @@ func (p *Proxy) ServeRequest(ctx context.Context, req server.Request, rsp server
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewProxy returns a new grpc proxy server
|
// NewProxy returns a new grpc proxy server
|
||||||
|
@ -187,8 +187,6 @@ func (p *Proxy) ServeRequest(ctx context.Context, req server.Request, rsp server
|
|||||||
return errors.InternalServerError(req.Service(), err.Error())
|
return errors.InternalServerError(req.Service(), err.Error())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewSingleHostProxy returns a router which sends requests to a single http backend
|
// NewSingleHostProxy returns a router which sends requests to a single http backend
|
||||||
|
@ -437,7 +437,7 @@ func (p *Proxy) serveRequest(ctx context.Context, link client.Client, service, e
|
|||||||
}
|
}
|
||||||
|
|
||||||
// create new request with raw bytes body
|
// create new request with raw bytes body
|
||||||
creq := link.NewRequest(service, endpoint, &bytes.Frame{body}, client.WithContentType(req.ContentType()))
|
creq := link.NewRequest(service, endpoint, &bytes.Frame{Data: body}, client.WithContentType(req.ContentType()))
|
||||||
|
|
||||||
// not a stream so make a client.Call request
|
// not a stream so make a client.Call request
|
||||||
if !req.Stream() {
|
if !req.Stream() {
|
||||||
@ -493,8 +493,6 @@ func (p *Proxy) serveRequest(ctx context.Context, link client.Client, service, e
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewSingleHostProxy returns a proxy which sends requests to a single backend
|
// NewSingleHostProxy returns a proxy which sends requests to a single backend
|
||||||
|
@ -105,7 +105,7 @@ func (m *mdnsRegistry) Register(service *Service, opts ...RegisterOption) error
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
srv, err := mdns.NewServer(&mdns.Config{Zone: &mdns.DNSSDService{s}})
|
srv, err := mdns.NewServer(&mdns.Config{Zone: &mdns.DNSSDService{MDNSService: s}})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -79,6 +79,4 @@ func (r *Registry) Watch(ctx context.Context, req *pb.WatchRequest, rsp pb.Regis
|
|||||||
return errors.InternalServerError("go.micro.registry", err.Error())
|
return errors.InternalServerError("go.micro.registry", err.Error())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
@ -187,6 +187,4 @@ func (r *Router) Watch(ctx context.Context, req *pb.WatchRequest, stream pb.Rout
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
@ -169,7 +169,7 @@ func (g *grpcCodec) Write(m *codec.Message, v interface{}) error {
|
|||||||
m.Body = b
|
m.Body = b
|
||||||
}
|
}
|
||||||
// write the body using the framing codec
|
// write the body using the framing codec
|
||||||
return g.s.SendMsg(&bytes.Frame{m.Body})
|
return g.s.SendMsg(&bytes.Frame{Data: m.Body})
|
||||||
}
|
}
|
||||||
|
|
||||||
func (g *grpcCodec) Close() error {
|
func (g *grpcCodec) Close() error {
|
||||||
|
@ -100,7 +100,7 @@ func (s *rpcServer) HandleEvent(e broker.Event) error {
|
|||||||
rpcMsg := &rpcMessage{
|
rpcMsg := &rpcMessage{
|
||||||
topic: msg.Header["Micro-Topic"],
|
topic: msg.Header["Micro-Topic"],
|
||||||
contentType: ct,
|
contentType: ct,
|
||||||
payload: &raw.Frame{msg.Body},
|
payload: &raw.Frame{Data: msg.Body},
|
||||||
codec: cf,
|
codec: cf,
|
||||||
header: msg.Header,
|
header: msg.Header,
|
||||||
body: msg.Body,
|
body: msg.Body,
|
||||||
|
@ -38,7 +38,6 @@ func (s *Socket) Accept(m *transport.Message) error {
|
|||||||
case <-s.closed:
|
case <-s.closed:
|
||||||
return io.EOF
|
return io.EOF
|
||||||
}
|
}
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Process takes the next message off the send queue created by a call to Send
|
// Process takes the next message off the send queue created by a call to Send
|
||||||
|
Loading…
Reference in New Issue
Block a user