chore: linter dependencies

This commit is contained in:
Jefferson Girão
2020-02-04 10:52:32 +01:00
parent 9806e518fd
commit b4d3213c28
3 changed files with 24 additions and 1 deletions
+1 -1
View File
@@ -12,5 +12,5 @@ type Server struct {
// GetEntity returns an inventory Entitity with the selected facts
func (s *Server) GetEntity(ctx context.Context, req *pb.GetEntityRequest) (*pb.GetEntityReply, error) {
return &pb.GetEntityReply{}, nil
return &pb.GetEntityReply{Entity: req.GetEntity()}, nil
}
+20
View File
@@ -0,0 +1,20 @@
package app
import (
"context"
"testing"
pb "github.com/spotify/backstage/inventory/protos"
)
func TestServer(t *testing.T) {
s := Server{}
req := &pb.GetEntityRequest{Entity: &pb.Entity{Kind: "test", Id: "test"}}
resp, err := s.GetEntity(context.Background(), req)
if err != nil {
t.Errorf("ServerTest(GetEntity) got unexpected error")
}
if resp.GetEntity().GetId() != req.GetEntity().GetId() {
t.Errorf("ServerTest(GetEntity) got %v, wanted %v", resp.GetEntity().GetId(), req.GetEntity().GetId())
}
}
+3
View File
@@ -5,5 +5,8 @@ go 1.12
require (
github.com/golang/protobuf v1.3.2
go.etcd.io/bbolt v1.3.3
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3 // indirect
golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135 // indirect
google.golang.org/grpc v1.27.0
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc // indirect
)