Background
When golangci-lint v2 was introduced as part of the deps update in #521 , two categories of pre-existing staticcheck issues were suppressed in `.golangci.yml`:
SA1019 — aws-sdk-go v1 deprecation warnings — tracked in feat: migrate from aws-sdk-go v1 to aws-sdk-go-v2 #523 (migrate to v2 SDK)
QF1012 — `WriteString(fmt.Sprintf(...))` style issues — tracked here
Once #523 is resolved, the SA1019 exclusion can also be removed.
QF1012 Issues to Fix
`controllers/provisioners/eks/helpers.go`:
Line
Current
Fix
621
`sb.WriteString(fmt.Sprintf("-Base64ClusterCA %v ", aws.StringValue(state.Cluster.CertificateAuthority.Data)))`
`fmt.Fprintf(&sb, "-Base64ClusterCA %v ", aws.StringValue(...))`
622
`sb.WriteString(fmt.Sprintf("-APIServerEndpoint %v ", aws.StringValue(state.Cluster.Endpoint)))`
`fmt.Fprintf(&sb, "-APIServerEndpoint %v ", aws.StringValue(...))`
625
`sb.WriteString(fmt.Sprintf("-ContainerRuntime %v ", bootstrapOptions.ContainerRuntime))`
`fmt.Fprintf(&sb, "-ContainerRuntime %v ", bootstrapOptions.ContainerRuntime)`
627
`sb.WriteString(fmt.Sprintf("-KubeletExtraArgs '%v'", ctx.GetKubeletExtraArgs()))`
`fmt.Fprintf(&sb, "-KubeletExtraArgs '%v'", ctx.GetKubeletExtraArgs())`
Note: `fmt.Fprintf` writes directly to the `strings.Builder` without allocating an intermediate string.
Definition of Done
All 4 QF1012 occurrences in `helpers.go` are rewritten using `fmt.Fprintf`
The `QF1012` rule is removed from `.golangci.yml`
The `SA1019` rule is removed from `.golangci.yml` as part of the v2 SDK migration (feat: migrate from aws-sdk-go v1 to aws-sdk-go-v2 #523 )
`golangci-lint run ./...` passes with no exclusion rules
Background
When golangci-lint v2 was introduced as part of the deps update in #521, two categories of pre-existing staticcheck issues were suppressed in `.golangci.yml`:
Once #523 is resolved, the SA1019 exclusion can also be removed.
QF1012 Issues to Fix
`controllers/provisioners/eks/helpers.go`:
Note: `fmt.Fprintf` writes directly to the `strings.Builder` without allocating an intermediate string.
Definition of Done