Fixing dead code and go vet moaning

This commit is contained in:
Milos Gajdos 2019-12-05 16:10:49 +00:00
parent 3a10b1cdde
commit 5865e89bed
No known key found for this signature in database
GPG Key ID: 8B31058CC55DFD4F
12 changed files with 5 additions and 19 deletions

View File

@ -172,7 +172,7 @@ func (g *grpcCodec) Write(m *codec.Message, v interface{}) error {
return g.s.SendMsg(v)
}
// 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 {

View File

@ -60,7 +60,6 @@ func (j *jsonCodec) ReadHeader(m *codec.Message, mt codec.MessageType) error {
default:
return fmt.Errorf("Unrecognised message type: %v", mt)
}
return nil
}
func (j *jsonCodec) ReadBody(b interface{}) error {

View File

@ -307,8 +307,6 @@ func (m *monitor) Stop() error {
m.running = false
return nil
}
return nil
}
func newMonitor(opts ...Option) Monitor {

View File

@ -135,8 +135,6 @@ func (p *Proxy) ServeRequest(ctx context.Context, req server.Request, rsp server
return err
}
}
return nil
}
// NewProxy returns a new grpc proxy server

View File

@ -187,8 +187,6 @@ func (p *Proxy) ServeRequest(ctx context.Context, req server.Request, rsp server
return errors.InternalServerError(req.Service(), err.Error())
}
}
return nil
}
// NewSingleHostProxy returns a router which sends requests to a single http backend

View File

@ -437,7 +437,7 @@ func (p *Proxy) serveRequest(ctx context.Context, link client.Client, service, e
}
// 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
if !req.Stream() {
@ -493,8 +493,6 @@ func (p *Proxy) serveRequest(ctx context.Context, link client.Client, service, e
return err
}
}
return nil
}
// NewSingleHostProxy returns a proxy which sends requests to a single backend

View File

@ -105,7 +105,7 @@ func (m *mdnsRegistry) Register(service *Service, opts ...RegisterOption) error
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 {
return err
}

View File

@ -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 nil
}

View File

@ -187,6 +187,4 @@ func (r *Router) Watch(ctx context.Context, req *pb.WatchRequest, stream pb.Rout
return err
}
}
return nil
}

View File

@ -169,7 +169,7 @@ func (g *grpcCodec) Write(m *codec.Message, v interface{}) error {
m.Body = b
}
// 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 {

View File

@ -100,7 +100,7 @@ func (s *rpcServer) HandleEvent(e broker.Event) error {
rpcMsg := &rpcMessage{
topic: msg.Header["Micro-Topic"],
contentType: ct,
payload: &raw.Frame{msg.Body},
payload: &raw.Frame{Data: msg.Body},
codec: cf,
header: msg.Header,
body: msg.Body,

View File

@ -38,7 +38,6 @@ func (s *Socket) Accept(m *transport.Message) error {
case <-s.closed:
return io.EOF
}
return nil
}
// Process takes the next message off the send queue created by a call to Send