Files
Terry Howe 818fd2e734 chore: raise go directive to 1.27 and fix modernize findings (#32810)
Dependabot bumps that pull in a dependency requiring Go 1.27 (#32786,
#32755) raise the go directive in go.mod, which in turn activates the
modernize analyzer's embedlit and stringscut checks. Those checks then
fire on pre-existing code and fail golangci-lint, so every such bump is
blocked on a cleanup it does not own.

Do the cleanup once, here, together with the directive bump that makes
it legal: neither fix compiles at go 1.26.0 (promoted-field keys in
composite literals and strings.CutLast are both Go 1.27).

Changes are the modernize autofix, reviewed:

- embedlit: drop the embedded field type from struct literals, mostly
  ObjectMeta/TypeMeta in tests, plus a few in production code.
- stringscut: parseTemplateSimpleErrorString now uses strings.CutLast
  instead of strings.LastIndex with manual slicing.

CI already builds with Go 1.27 (GOLANG_VERSION in .github/env), so this
only aligns the module's declared language version with the toolchain.

Signed-off-by: Terry Howe <thowe@nvidia.com>
2026-10-26 08:10:41 -06:00
..
2026-07-27 19:53:24 +02:00
2026-07-24 19:06:05 +02:00