Skip to content
Open
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: 1 addition & 1 deletion agent/metrics/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"time"

monitoring "cloud.google.com/go/monitoring/apiv3"
googlepb "github.com/golang/protobuf/ptypes/timestamp"
googlepb "google.golang.org/protobuf/types/known/timestamppb"
gax "github.com/googleapis/gax-go/v2"
apioption "google.golang.org/api/option"
metricpb "google.golang.org/genproto/googleapis/api/metric"
Expand Down
8 changes: 4 additions & 4 deletions app/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ func requestHandler(ctx context.Context, s types.Store, w http.ResponseWriter, r
requestID := r.Header.Get(HeaderRequestID)
if requestID == "" {
errorMsg := "No request ID specified"
log.Printf(errorMsg)
log.Println(errorMsg)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not aware of any Golang best practices/guidance around not using the *Printf methods for literal strings.

At the very least, however, if we were to make this change then it should be a separate, isolated PR

http.Error(w, errorMsg, http.StatusBadRequest)
return
}
Expand All @@ -219,7 +219,7 @@ func requestHandler(ctx context.Context, s types.Store, w http.ResponseWriter, r
request, err := s.ReadRequest(ctx, backendID, requestID)
if err != nil {
errorMsg := fmt.Sprintf("Failed to read the request for %q: %q", requestID, err.Error())
log.Printf(errorMsg)
log.Println(errorMsg)
http.Error(w, errorMsg, http.StatusNotFound)
return
}
Expand All @@ -240,7 +240,7 @@ func responseHandler(ctx context.Context, s types.Store, w http.ResponseWriter,
response, err := parseResponse(backendID, r)
if err != nil {
errorMsg := fmt.Sprintf("Failed to read the response body: %q", err.Error())
log.Printf(errorMsg)
log.Println(errorMsg)
http.Error(w, errorMsg, http.StatusBadRequest)
return
}
Expand All @@ -250,7 +250,7 @@ func responseHandler(ctx context.Context, s types.Store, w http.ResponseWriter,
close(notFoundErrs)
if len(notFoundErrs) > 0 {
notFoundErr := <-notFoundErrs
log.Printf(notFoundErr.Error())
log.Println(notFoundErr.Error())
http.Error(w, notFoundErr.Error(), http.StatusNotFound)
return
}
Expand Down
62 changes: 37 additions & 25 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,33 +1,45 @@
module github.com/google/inverting-proxy

go 1.18
go 1.24.2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not aware of a good reason to change this.

This isn't specifying what version of Go you use to build the packages; that's something controlled by the build environment and commands you use.

Instead, this is the minimum version required.

So, changing this is basically saying: "Force the build to fail if someone has anything other than the latest version of Golang installed", and that's a really heavy handed thing to do.


require (
cloud.google.com/go/compute/metadata v0.2.3
cloud.google.com/go/monitoring v1.13.0
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da
github.com/golang/protobuf v1.5.3
github.com/google/go-cmp v0.5.9
github.com/google/uuid v1.3.0
github.com/googleapis/gax-go/v2 v2.7.1
github.com/gorilla/websocket v1.5.0
golang.org/x/net v0.23.0
golang.org/x/oauth2 v0.7.0
google.golang.org/api v0.114.0
google.golang.org/appengine/v2 v2.0.2
google.golang.org/genproto v0.0.0-20230526161137-0005af68ea54
google.golang.org/genproto/googleapis/api v0.0.0-20230525234035-dd9d682886f9
google.golang.org/grpc v1.56.3
google.golang.org/grpc/examples v0.0.0-20230602173802-c9d3ea567325
cloud.google.com/go/compute/metadata v0.6.0
cloud.google.com/go/monitoring v1.24.2
github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8
github.com/google/go-cmp v0.7.0
github.com/google/uuid v1.6.0
github.com/googleapis/gax-go/v2 v2.14.1
github.com/gorilla/websocket v1.5.3
golang.org/x/net v0.39.0
golang.org/x/oauth2 v0.29.0
google.golang.org/api v0.229.0
google.golang.org/appengine/v2 v2.0.6
google.golang.org/genproto v0.0.0-20250422160041-2d3770c4ea7f
google.golang.org/genproto/googleapis/api v0.0.0-20250422160041-2d3770c4ea7f
google.golang.org/grpc v1.72.0
google.golang.org/grpc/examples v0.0.0-20250421233052-f7d488de751d
google.golang.org/protobuf v1.36.6
)

require (
cloud.google.com/go/compute v1.19.1 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.2.3 // indirect
go.opencensus.io v0.24.0 // indirect
golang.org/x/sys v0.18.0 // indirect
golang.org/x/text v0.14.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19 // indirect
google.golang.org/protobuf v1.33.0 // indirect
cloud.google.com/go/auth v0.16.0 // indirect
cloud.google.com/go/auth/oauth2adapt v0.2.8 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/google/s2a-go v0.1.9 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.3.6 // indirect
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.60.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.60.0 // indirect
go.opentelemetry.io/otel v1.35.0 // indirect
go.opentelemetry.io/otel/metric v1.35.0 // indirect
go.opentelemetry.io/otel/trace v1.35.0 // indirect
golang.org/x/crypto v0.37.0 // indirect
golang.org/x/sync v0.13.0 // indirect
golang.org/x/sys v0.32.0 // indirect
golang.org/x/text v0.24.0 // indirect
golang.org/x/time v0.11.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20250414145226-207652e42e2e // indirect
)
Loading