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

.: bump go version to go1.21 #304

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Expand Up @@ -4,7 +4,7 @@ jobs:
build:
strategy:
matrix:
go-version: [1.20.x, 1.21.x]
go-version: [1.21.x, 1.22.x]
platform: [windows-latest]
runs-on: ${{ matrix.platform }}
steps:
Expand All @@ -24,7 +24,7 @@ jobs:
test:
strategy:
matrix:
go-version: [1.20.x, 1.21.x]
go-version: [1.21.x, 1.22.x]
platform: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.platform }}
steps:
Expand Down
1 change: 0 additions & 1 deletion exec/fixup_go118.go
@@ -1,5 +1,4 @@
//go:build !go1.19
// +build !go1.19

/*
Copyright 2022 The Kubernetes Authors.
Expand Down
1 change: 0 additions & 1 deletion exec/fixup_go119.go
@@ -1,5 +1,4 @@
//go:build go1.19
// +build go1.19

/*
Copyright 2022 The Kubernetes Authors.
Expand Down
2 changes: 1 addition & 1 deletion go.mod
@@ -1,6 +1,6 @@
module k8s.io/utils

go 1.18
go 1.21
Copy link
Member

Choose a reason for hiding this comment

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

/hold

This doesn't do what you think it does :-/

This forces anything importing this module to also bump its own go module directive to go1.21, and makes go change the defaults for godebug compatibility switch defaults. golang/go#65573 is an open proposal to improve this in go1.23, but until that lands, we need to avoid bumping our go directives past go1.20 in our release-from-HEAD repos like utils/kube-openapi/gengo/etc.

Because this repo only releases from HEAD, if we find a bug we need to fix and backport to older kubernetes versions (like 1.27), this would bump the go.mod version in 1.27 from go1.20 to go1.21, which we don't want. Repos that have release branches (like k/k) are more reasonable to keep pushing the go.mod to latest go at HEAD.

golang.org/x/... modules also keep their go directive at the oldest language version you can build with (e.g. https://cs.opensource.google/go/x/sys/+/master:go.mod has 1.18).


require (
github.com/davecgh/go-spew v1.1.1
Expand Down
1 change: 0 additions & 1 deletion inotify/inotify_linux.go
@@ -1,5 +1,4 @@
//go:build linux
// +build linux

// Copyright 2010 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
Expand Down
1 change: 0 additions & 1 deletion inotify/inotify_linux_test.go
@@ -1,5 +1,4 @@
//go:build linux
// +build linux

// Copyright 2010 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
Expand Down
2 changes: 1 addition & 1 deletion inotify/inotify_others.go
@@ -1,4 +1,4 @@
// +build !linux
//go:build !linux

/*
Copyright 2020 The Kubernetes Authors.
Expand Down
1 change: 0 additions & 1 deletion mount/mount_helper_unix.go
@@ -1,5 +1,4 @@
//go:build !windows
// +build !windows

/*
Copyright 2019 The Kubernetes Authors.
Expand Down
1 change: 0 additions & 1 deletion mount/mount_helper_unix_test.go
@@ -1,5 +1,4 @@
//go:build !windows
// +build !windows

/*
Copyright 2019 The Kubernetes Authors.
Expand Down
1 change: 0 additions & 1 deletion mount/mount_helper_windows.go
@@ -1,5 +1,4 @@
//go:build windows
// +build windows

/*
Copyright 2019 The Kubernetes Authors.
Expand Down
1 change: 0 additions & 1 deletion mount/mount_helper_windows_test.go
@@ -1,5 +1,4 @@
//go:build windows
// +build windows

/*
Copyright 2017 The Kubernetes Authors.
Expand Down
1 change: 0 additions & 1 deletion mount/mount_linux.go
@@ -1,5 +1,4 @@
//go:build linux
// +build linux

/*
Copyright 2014 The Kubernetes Authors.
Expand Down
1 change: 0 additions & 1 deletion mount/mount_linux_test.go
@@ -1,5 +1,4 @@
//go:build linux
// +build linux

/*
Copyright 2014 The Kubernetes Authors.
Expand Down
1 change: 0 additions & 1 deletion mount/mount_unsupported.go
@@ -1,5 +1,4 @@
//go:build !linux && !windows
// +build !linux,!windows

/*
Copyright 2014 The Kubernetes Authors.
Expand Down
1 change: 0 additions & 1 deletion mount/mount_windows.go
@@ -1,5 +1,4 @@
//go:build windows
// +build windows

/*
Copyright 2017 The Kubernetes Authors.
Expand Down
1 change: 0 additions & 1 deletion mount/mount_windows_test.go
@@ -1,5 +1,4 @@
//go:build windows
// +build windows

/*
Copyright 2017 The Kubernetes Authors.
Expand Down
1 change: 0 additions & 1 deletion nsenter/nsenter.go
@@ -1,5 +1,4 @@
//go:build linux
// +build linux

/*
Copyright 2017 The Kubernetes Authors.
Expand Down
1 change: 0 additions & 1 deletion nsenter/nsenter_test.go
@@ -1,5 +1,4 @@
//go:build linux
// +build linux

/*
Copyright 2018 The Kubernetes Authors.
Expand Down
1 change: 0 additions & 1 deletion nsenter/nsenter_unsupported.go
@@ -1,5 +1,4 @@
//go:build !linux
// +build !linux

/*
Copyright 2017 The Kubernetes Authors.
Expand Down