Skip to content

Commit

Permalink
minor fixes for google3 import (#608)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrahs authored Dec 18, 2024
1 parent befae13 commit 063ce64
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
2 changes: 0 additions & 2 deletions go/cmd/bazelcredswrapper/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ var (
)

func main() {
defer log.Flush()
flag.Parse()
log.Flush()
var err error
if *credsPath == "" {
log.Errorf("No credentials helper path provided.")
Expand Down
14 changes: 8 additions & 6 deletions go/pkg/client/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ import (
"testing"

"github.com/bazelbuild/remote-apis-sdks/go/pkg/digest"
regrpc "github.com/bazelbuild/remote-apis/build/bazel/remote/execution/v2"
repb "github.com/bazelbuild/remote-apis/build/bazel/remote/execution/v2"
svpb "github.com/bazelbuild/remote-apis/build/bazel/semver"
"github.com/google/go-cmp/cmp"
bsgrpc "google.golang.org/genproto/googleapis/bytestream"
bspb "google.golang.org/genproto/googleapis/bytestream"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
Expand Down Expand Up @@ -301,8 +303,8 @@ func TestRemoteHeaders(t *testing.T) {
defer listener.Close()
server := grpc.NewServer()
fake := &fakeByteStreamForRemoteHeaders{}
bspb.RegisterByteStreamServer(server, fake)
repb.RegisterCapabilitiesServer(server, &fakeCapabilitiesForRemoteHeaders{})
bsgrpc.RegisterByteStreamServer(server, fake)
regrpc.RegisterCapabilitiesServer(server, &fakeCapabilitiesForRemoteHeaders{})
go server.Serve(listener)
defer server.Stop()

Expand Down Expand Up @@ -332,11 +334,11 @@ func TestRemoteHeaders(t *testing.T) {
}

type fakeByteStreamForRemoteHeaders struct {
bspb.UnimplementedByteStreamServer
bsgrpc.UnimplementedByteStreamServer
readHeaders, writeHeaders metadata.MD
}

func (bs *fakeByteStreamForRemoteHeaders) Read(req *bspb.ReadRequest, stream bspb.ByteStream_ReadServer) error {
func (bs *fakeByteStreamForRemoteHeaders) Read(req *bspb.ReadRequest, stream bsgrpc.ByteStream_ReadServer) error {
md, ok := metadata.FromIncomingContext(stream.Context())
if !ok {
return status.Error(codes.InvalidArgument, "metadata not found")
Expand All @@ -346,7 +348,7 @@ func (bs *fakeByteStreamForRemoteHeaders) Read(req *bspb.ReadRequest, stream bsp
return nil
}

func (bs *fakeByteStreamForRemoteHeaders) Write(stream bspb.ByteStream_WriteServer) error {
func (bs *fakeByteStreamForRemoteHeaders) Write(stream bsgrpc.ByteStream_WriteServer) error {
md, ok := metadata.FromIncomingContext(stream.Context())
if !ok {
return status.Error(codes.InvalidArgument, "metadata not found")
Expand All @@ -364,7 +366,7 @@ func (bs *fakeByteStreamForRemoteHeaders) Write(stream bspb.ByteStream_WriteServ
}

type fakeCapabilitiesForRemoteHeaders struct {
repb.UnimplementedCapabilitiesServer
regrpc.UnimplementedCapabilitiesServer
}

func (cap *fakeCapabilitiesForRemoteHeaders) GetCapabilities(ctx context.Context, req *repb.GetCapabilitiesRequest) (*repb.ServerCapabilities, error) {
Expand Down
4 changes: 4 additions & 0 deletions go/pkg/moreflag/moreflag.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,10 @@ func (m *StringListMapValue) Set(s string) error {
return nil
}

func (m *StringListMapValue) Get() interface{} {
return map[string][]string(*m)
}

// parsePairs parses a string of the form "key1=value1,key2=value2", returning
// a slice with an even number of strings like "key1", "value1", "key2",
// "value2". Pairs are separated by ','; keys and values are separated by '='.
Expand Down

0 comments on commit 063ce64

Please sign in to comment.