Skip to content

Remove tools.go and require Go 1.24 #3181

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

Merged
merged 2 commits into from
Feb 27, 2025
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
1 change: 0 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ linters:
- staticcheck
- stylecheck
- tagalign
- tenv
- thelper
- tparallel
- typecheck
Expand Down
6 changes: 4 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
module github.com/nginx/nginx-gateway-fabric

go 1.23.0
go 1.24.0

require (
github.com/go-kit/log v0.2.1
github.com/go-logr/logr v1.4.2
github.com/google/go-cmp v0.7.0
github.com/maxbrunsfeld/counterfeiter/v6 v6.11.2
github.com/nginx/telemetry-exporter v0.1.3
github.com/nginxinc/nginx-plus-go-client v1.3.0
github.com/nginxinc/nginx-prometheus-exporter v1.3.0
Expand Down Expand Up @@ -57,6 +56,7 @@ require (
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/compress v1.17.9 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/maxbrunsfeld/counterfeiter/v6 v6.11.2 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
Expand Down Expand Up @@ -94,3 +94,5 @@ require (
sigs.k8s.io/structured-merge-diff/v4 v4.4.2 // indirect
sigs.k8s.io/yaml v1.4.0 // indirect
)

tool github.com/maxbrunsfeld/counterfeiter/v6
2 changes: 1 addition & 1 deletion internal/framework/controller/fakes.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
_ "sigs.k8s.io/controller-runtime/pkg/manager" // used below to generate a fake
)

//go:generate go run github.com/maxbrunsfeld/counterfeiter/v6 -generate
//go:generate go tool counterfeiter -generate

//counterfeiter:generate sigs.k8s.io/controller-runtime/pkg/manager.Manager

Expand Down
2 changes: 1 addition & 1 deletion internal/framework/events/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"github.com/go-logr/logr"
)

//go:generate go run github.com/maxbrunsfeld/counterfeiter/v6 -generate
//go:generate go tool counterfeiter -generate
//counterfeiter:generate . EventHandler

// EventHandler handles events.
Expand Down
2 changes: 1 addition & 1 deletion internal/framework/kubernetes/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package kubernetes

import "sigs.k8s.io/controller-runtime/pkg/client"

//go:generate go run github.com/maxbrunsfeld/counterfeiter/v6 -generate
//go:generate go tool counterfeiter -generate

//counterfeiter:generate . Reader

Expand Down
2 changes: 1 addition & 1 deletion internal/framework/status/k8s_updater.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
// K8sUpdater updates a resource from the k8s API.
// It allows us to mock the client.Reader.Status.Update method.
//
//go:generate go run github.com/maxbrunsfeld/counterfeiter/v6 -generate
//go:generate go tool counterfeiter -generate
//counterfeiter:generate . K8sUpdater
type K8sUpdater interface {
// Update is from client.StatusClient.SubResourceWriter.
Expand Down
2 changes: 1 addition & 1 deletion internal/mode/static/licensing/collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/nginx/nginx-gateway-fabric/internal/mode/static/telemetry"
)

//go:generate go run github.com/maxbrunsfeld/counterfeiter/v6 -generate
//go:generate go tool counterfeiter -generate

//counterfeiter:generate . Collector

Expand Down
2 changes: 1 addition & 1 deletion internal/mode/static/nginx/config/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
"github.com/nginx/nginx-gateway-fabric/internal/mode/static/state/dataplane"
)

//go:generate go run github.com/maxbrunsfeld/counterfeiter/v6 -generate
//go:generate go tool counterfeiter -generate
//counterfeiter:generate . Generator

// Volumes here also need to be added to our crossplane ephemeral test container.
Expand Down
2 changes: 1 addition & 1 deletion internal/mode/static/nginx/config/policies/policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"sigs.k8s.io/gateway-api/apis/v1alpha2"
)

//go:generate go run github.com/maxbrunsfeld/counterfeiter/v6 -generate
//go:generate go tool counterfeiter -generate

// Policy is an extension of client.Object. It adds methods that are common among all NGF Policies.
//
Expand Down
2 changes: 1 addition & 1 deletion internal/mode/static/nginx/config/policies/validator.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package policies

//go:generate go run github.com/maxbrunsfeld/counterfeiter/v6 -generate
//go:generate go tool counterfeiter -generate

import (
"fmt"
Expand Down
2 changes: 1 addition & 1 deletion internal/mode/static/nginx/file/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/go-logr/logr"
)

//go:generate go run github.com/maxbrunsfeld/counterfeiter/v6 -generate
//go:generate go tool counterfeiter -generate

const (
// regularFileMode defines the default file mode for regular files.
Expand Down
2 changes: 1 addition & 1 deletion internal/mode/static/nginx/runtime/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
"k8s.io/apimachinery/pkg/util/wait"
)

//go:generate go run github.com/maxbrunsfeld/counterfeiter/v6 -generate
//go:generate go tool counterfeiter -generate

const (
// PidFile specifies the location of the PID file for the Nginx process.
Expand Down
2 changes: 1 addition & 1 deletion internal/mode/static/nginx/runtime/verify.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const configVersionURI = "/var/run/nginx/nginx-config-version.sock"
var noNewWorkersErrFmt = "reload unsuccessful: no new NGINX worker processes started for config version %d." +
" Please check the NGINX container logs for possible configuration issues: %w"

//go:generate go run github.com/maxbrunsfeld/counterfeiter/v6 . nginxConfigVerifier
//go:generate go tool counterfeiter . nginxConfigVerifier

type nginxConfigVerifier interface {
GetConfigVersion() (int, error)
Expand Down
2 changes: 1 addition & 1 deletion internal/mode/static/state/change_processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
"github.com/nginx/nginx-gateway-fabric/internal/mode/static/state/validation"
)

//go:generate go run github.com/maxbrunsfeld/counterfeiter/v6 -generate
//go:generate go tool counterfeiter -generate

// ChangeType is the type of change that occurred based on a k8s object event.
type ChangeType int
Expand Down
2 changes: 1 addition & 1 deletion internal/mode/static/state/resolver/resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"github.com/nginx/nginx-gateway-fabric/internal/framework/controller/index"
)

//go:generate go run github.com/maxbrunsfeld/counterfeiter/v6 -generate
//go:generate go tool counterfeiter -generate
//counterfeiter:generate . ServiceResolver

// ServiceResolver resolves a Service's NamespacedName and ServicePort to a list of Endpoints.
Expand Down
2 changes: 1 addition & 1 deletion internal/mode/static/state/validation/validator.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package validation

//go:generate go run github.com/maxbrunsfeld/counterfeiter/v6 -generate
//go:generate go tool counterfeiter -generate

import (
"github.com/nginx/nginx-gateway-fabric/internal/framework/conditions"
Expand Down
2 changes: 1 addition & 1 deletion internal/mode/static/telemetry/exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

// Exporter exports telemetry data to some destination.
//
//go:generate go run github.com/maxbrunsfeld/counterfeiter/v6 -generate
//go:generate go tool counterfeiter -generate
//counterfeiter:generate . Exporter
type Exporter interface {
Export(ctx context.Context, data tel.Exportable) error
Expand Down
2 changes: 1 addition & 1 deletion tests/framework/crossplane/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/nginx/nginx-gateway-fabric/tests/framework/crossplane

go 1.23.1
go 1.24.0

require github.com/nginxinc/nginx-go-crossplane v0.4.73

Expand Down
2 changes: 1 addition & 1 deletion tests/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/nginx/nginx-gateway-fabric/tests

go 1.23.0
go 1.24.0

replace github.com/nginx/nginx-gateway-fabric => ../

Expand Down
11 changes: 0 additions & 11 deletions tools.go

This file was deleted.