chore: remove redundant x/net/http2 and automaxprocs deps

ForceAttemptHTTP2 + NextProtos ALPN already handle HTTP/2 on Go 1.22+.
Go 1.25+ runtime is container-aware for GOMAXPROCS by default.
This commit is contained in:
Julian Sommer
2026-03-18 10:14:52 +10:00
parent 48bbe423df
commit 4152e4422f
4 changed files with 2 additions and 23 deletions
+2 -2
View File
@@ -18,8 +18,6 @@ require (
github.com/spf13/cobra v1.10.2
github.com/spf13/viper v1.21.0
github.com/stretchr/testify v1.11.1
go.uber.org/automaxprocs v1.6.0
golang.org/x/net v0.51.0
gopkg.in/ini.v1 v1.67.1
)
@@ -114,11 +112,13 @@ require (
go.opentelemetry.io/otel v1.41.0 // indirect
go.opentelemetry.io/otel/metric v1.41.0 // indirect
go.opentelemetry.io/otel/trace v1.41.0 // indirect
go.uber.org/automaxprocs v1.6.0 // indirect
go.yaml.in/yaml/v2 v2.4.3 // indirect
go.yaml.in/yaml/v3 v3.0.4 // indirect
golang.org/x/crypto v0.48.0 // indirect
golang.org/x/exp/typeparams v0.0.0-20260218203240-3dfff04db8fa // indirect
golang.org/x/mod v0.33.0 // indirect
golang.org/x/net v0.51.0 // indirect
golang.org/x/sync v0.19.0 // indirect
golang.org/x/sys v0.41.0 // indirect
golang.org/x/telemetry v0.0.0-20260304144227-18da59047661 // indirect
-6
View File
@@ -8,7 +8,6 @@ import (
"crypto/tls"
"errors"
"io"
"log/slog"
"net/http"
"strings"
"sync"
@@ -18,7 +17,6 @@ import (
"github.com/aws/aws-sdk-go/aws/credentials"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/s3"
"golang.org/x/net/http2"
)
// NoSuchKeyError represents a missing object error, compatible with AWS S3 errors
@@ -67,10 +65,6 @@ func NewS3ObjectStoreFromConfig(host, region, accessKey, secretKey string) *S3Ob
ForceAttemptHTTP2: true,
}
if err := http2.ConfigureTransport(tr); err != nil {
slog.Warn("Failed to configure HTTP/2", "error", err)
}
httpClient := &http.Client{Transport: tr}
sess := session.Must(session.NewSession(&aws.Config{
-9
View File
@@ -7,7 +7,6 @@ import (
"github.com/mulgadc/hive/hive/utils"
"github.com/nats-io/nats-server/v2/server"
"go.uber.org/automaxprocs/maxprocs"
)
var serviceName = "nats"
@@ -118,14 +117,6 @@ func launchService(config *Config) (err error) {
server.PrintAndDie(err.Error())
}
// Adjust MAXPROCS if running under linux/cgroups quotas.
undo, err := maxprocs.Set(maxprocs.Logger(ns.Debugf))
if err != nil {
slog.Warn("Failed to set GOMAXPROCS", "err", err)
} else {
defer undo()
}
ns.WaitForShutdown()
return nil
-6
View File
@@ -27,7 +27,6 @@ import (
"github.com/mulgadc/hive/hive/awserrors"
"github.com/mulgadc/hive/hive/config"
"github.com/pterm/pterm"
"golang.org/x/net/http2"
)
// GenerateResourceID generates a unique resource ID with the given prefix.
@@ -214,11 +213,6 @@ func CreateS3Client(cfg *config.Config) *s3.S3 {
ForceAttemptHTTP2: true,
}
// CRITICAL: Configure HTTP/2 support with custom TLS config
if err := http2.ConfigureTransport(tr); err != nil {
slog.Warn("Failed to configure HTTP/2", "error", err)
}
httpClient := &http.Client{Transport: tr}
sess := session.Must(session.NewSession(&aws.Config{