Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

minor fixes for google3 import #608

Merged
merged 1 commit into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@
"testing"

"github.com/bazelbuild/remote-apis-sdks/go/pkg/digest"
regrpc "github.com/bazelbuild/remote-apis/build/bazel/remote/execution/v2"

Check failure on line 13 in go/pkg/client/client_test.go

View workflow job for this annotation

GitHub Actions / lint

ST1019: package "github.com/bazelbuild/remote-apis/build/bazel/remote/execution/v2" is being imported more than once (stylecheck)
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"

Check failure on line 17 in go/pkg/client/client_test.go

View workflow job for this annotation

GitHub Actions / lint

ST1019: package "google.golang.org/genproto/googleapis/bytestream" is being imported more than once (stylecheck)
bspb "google.golang.org/genproto/googleapis/bytestream"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
Expand Down Expand Up @@ -301,8 +303,8 @@
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 @@
}

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

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
Loading