Skip to content

Commit e99c3eb

Browse files
authored
Upgrade to Go 1.23.1 (#264)
* Upgrade to Go 1.23.1 Signed-off-by: Ignasi Barrera <ignasi@tetrate.io> * Upgrade linter to a version that supports go 1.23 Signed-off-by: Ignasi Barrera <ignasi@tetrate.io> --------- Signed-off-by: Ignasi Barrera <ignasi@tetrate.io>
1 parent 2360795 commit e99c3eb

File tree

8 files changed

+12
-16
lines changed

8 files changed

+12
-16
lines changed

.golangci.yml

+4-8
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
run:
16-
skip-files:
15+
issues:
16+
exclude-files:
1717
- ".*\\.pb.*\\.go"
1818
linters:
1919
enable:
@@ -29,20 +29,16 @@ linters:
2929
- unused
3030
- staticcheck
3131
- gosimple
32-
- megacheck
3332
disable:
34-
- interfacer # deprecated since it "is prone to bad suggestions"
3533
- goimports # already run in `make format`
36-
- deadcode # Deprecated. Author abandoned it.
37-
- structcheck # Deprecated. Author abandoned it.
38-
- varcheck # Deprecated. Author abandoned it.
3934
linters-settings:
4035
lll:
4136
line-length: 160
4237
goconst:
4338
min-occurrences: 4
4439
govet:
45-
check-shadowing: true
40+
enable:
41+
- shadow
4642
revive:
4743
ignore-generated-header: false
4844
severity: error

e2e/testclient.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ func (a *AddressMappings) DialContext(ctx context.Context, network, addr string)
113113

114114
// DialTLSContext is a custom dialer that resolves specific host:port to specific target addresses.
115115
func (a *AddressMappings) DialTLSContext(tlsConfig *tls.Config) func(context.Context, string, string) (net.Conn, error) {
116-
return func(ctx context.Context, network, addr string) (net.Conn, error) {
116+
return func(_ context.Context, network, addr string) (net.Conn, error) {
117117
cfg := tlsConfig.Clone()
118118
if resolved, ok := a.addresses[addr]; ok {
119119
// Use the original hostname for the SNI, to avoid certificate verification errors

env.mk

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ NAME ?= authservice
1818

1919
-include $(ROOT)/.makerc # Pick up any local overrides.
2020

21-
GOLANGCI_LINT ?= github.com/golangci/golangci-lint/cmd/golangci-lint@v1.52.2
21+
GOLANGCI_LINT ?= github.com/golangci/golangci-lint/cmd/golangci-lint@v1.60.3
2222
GOSIMPORTS ?= github.com/rinchsan/gosimports/cmd/gosimports@v0.3.8
2323
LICENSER ?= github.com/liamawhite/licenser@v0.6.1-0.20210729145742-be6c77bf6a1f
2424
KIND ?= sigs.k8s.io/kind@v0.18.0

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/istio-ecosystem/authservice
22

3-
go 1.22.5
3+
go 1.23.1
44

55
require (
66
github.com/alicebob/miniredis/v2 v2.31.1

internal/authz/oidc_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -1645,7 +1645,7 @@ func newServer(wellKnownPayload string) *idpServer {
16451645
idpServer := &idpServer{server: s, listener: bufconn.Listen(1024)}
16461646

16471647
handler := http.NewServeMux()
1648-
handler.HandleFunc("/token", func(w http.ResponseWriter, r *http.Request) {
1648+
handler.HandleFunc("/token", func(w http.ResponseWriter, _ *http.Request) {
16491649
w.Header().Set("Content-Type", "application/json")
16501650
w.WriteHeader(idpServer.statusCode)
16511651

@@ -1656,7 +1656,7 @@ func newServer(wellKnownPayload string) *idpServer {
16561656
}
16571657
}
16581658
})
1659-
handler.HandleFunc("/.well-known/openid-configuration", func(w http.ResponseWriter, r *http.Request) {
1659+
handler.HandleFunc("/.well-known/openid-configuration", func(w http.ResponseWriter, _ *http.Request) {
16601660
w.Header().Set("Content-Type", "application/json")
16611661
w.WriteHeader(http.StatusOK)
16621662
_, _ = w.Write([]byte(wellKnownPayload))

internal/oidc/discovery_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ func newServer() *idpServer {
104104
idpServer := &idpServer{server: s, listener: bufconn.Listen(1024)}
105105

106106
handler := http.NewServeMux()
107-
handler.HandleFunc("/.well-known/openid-configuration", func(w http.ResponseWriter, r *http.Request) {
107+
handler.HandleFunc("/.well-known/openid-configuration", func(w http.ResponseWriter, _ *http.Request) {
108108
w.Header().Set("Content-Type", "application/json")
109109
w.WriteHeader(http.StatusOK)
110110
if idpServer.wellKnownConfig != "" {

internal/oidc/jwks_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ func TestDynamicJWKSProvider(t *testing.T) {
155155
jwks = newKeySet(t, pub)
156156

157157
tlsPool = internal.NewTLSConfigPool(context.Background())
158-
newCache = func(t *testing.T, oidc *oidcv1.OIDCConfig) JWKSProvider {
158+
newCache = func(_ *testing.T, oidc *oidcv1.OIDCConfig) JWKSProvider {
159159
cfg := &configv1.Config{
160160
Chains: []*configv1.FilterChain{
161161
{

internal/server/requestid_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ func TestPropagateRequestId(t *testing.T) {
3737
for _, tt := range tests {
3838
t.Run(tt.name, func(t *testing.T) {
3939
ctx := context.Background()
40-
_, _ = PropagateRequestID(ctx, tt.req, nil, func(ctx context.Context, req interface{}) (interface{}, error) {
40+
_, _ = PropagateRequestID(ctx, tt.req, nil, func(ctx context.Context, _ interface{}) (interface{}, error) {
4141
kvs := telemetry.KeyValuesFromContext(ctx)
4242
require.Equal(t, tt.want, kvs)
4343
return nil, nil

0 commit comments

Comments
 (0)