Merge pull request #1023 from milosgajdos83/dead-code
Fixing dead code and go vet moaning
This commit is contained in:
		| @@ -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 { | ||||
|   | ||||
| @@ -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 { | ||||
|   | ||||
| @@ -307,8 +307,6 @@ func (m *monitor) Stop() error { | ||||
| 		m.running = false | ||||
| 		return nil | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| func newMonitor(opts ...Option) Monitor { | ||||
|   | ||||
| @@ -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 | ||||
|   | ||||
| @@ -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 | ||||
|   | ||||
| @@ -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 | ||||
|   | ||||
| @@ -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 | ||||
| 		} | ||||
|   | ||||
| @@ -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 | ||||
| } | ||||
|   | ||||
| @@ -187,6 +187,4 @@ func (r *Router) Watch(ctx context.Context, req *pb.WatchRequest, stream pb.Rout | ||||
| 			return err | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|   | ||||
| @@ -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 { | ||||
|   | ||||
| @@ -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, | ||||
|   | ||||
| @@ -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 | ||||
|   | ||||
		Reference in New Issue
	
	Block a user