chore: linter dependencies
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
@@ -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())
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user