Skip to content

Commit 6f5eb1e

Browse files
committed
fix(lint): resolve gofmt and SA4023 failures from golangci-lint v2.13.1
The golangci-lint pin moved to v2.13.1 in #2351, which surfaced four pre-existing issues that fail the merge gate on main: - pkg/diff/topology_test.go: Go 1.27 gofmt reindents the multi-value composite-literal return in collidingCluster(). - tools/testgrid-publish/main.go: SA4023 flags the err != nil guard in extractSigner() as always true, because readPointerFromAttestation is a documented stub that unconditionally returns ErrCodeInternal. The guard is the contract for the real implementation (#1267), so it is suppressed rather than removed. Signed-off-by: Mark Chmarny <mark@chmarny.com>
1 parent f7c64ef commit 6f5eb1e

2 files changed

Lines changed: 10 additions & 10 deletions

File tree

pkg/diff/topology_test.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,13 @@ func refLabelItem(key, value, dataKey string, count int) measurement.ItemEntry {
8787
// the vintages — the count as well as the presence of items.
8888
func collidingCluster() (map[string]string, []measurement.ItemEntry) {
8989
return map[string]string{
90-
"zone.us-west": "true|gpu-a,gpu-b",
91-
"zone.us-east": "us-east|gpu-b",
92-
}, []measurement.ItemEntry{
93-
labelItem("zone", "us-east", "gpu-b"),
94-
labelItem("zone", "us-west", "gpu-a"),
95-
labelItem("zone.us-west", "true", "gpu-a,gpu-b"),
96-
}
90+
"zone.us-west": "true|gpu-a,gpu-b",
91+
"zone.us-east": "us-east|gpu-b",
92+
}, []measurement.ItemEntry{
93+
labelItem("zone", "us-east", "gpu-b"),
94+
labelItem("zone", "us-west", "gpu-a"),
95+
labelItem("zone.us-west", "true", "gpu-a,gpu-b"),
96+
}
9797
}
9898

9999
// TestSnapshots_UpgradeIsNotDrift pins that capturing a baseline with an older

tools/testgrid-publish/main.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -309,8 +309,8 @@ func resultString(passed bool) string {
309309
// extractSigner reads signer identity and issuer from the bundle's
310310
// attestation.intoto.jsonl if present; returns empty strings otherwise.
311311
func extractSigner(bundleDir string) (identity, issuer string) {
312-
pointer, err := readPointerFromAttestation(bundleDir)
313-
if err != nil || pointer == nil || len(pointer.Attestations) == 0 {
312+
pointer, err := readPointerFromAttestation(bundleDir) //nolint:staticcheck // SA4023: stub always errors today; see readPointerFromAttestation
313+
if err != nil || pointer == nil || len(pointer.Attestations) == 0 { //nolint:staticcheck // SA4023: guard is the contract for the real implementation (#1267)
314314
return "", ""
315315
}
316316
att := pointer.Attestations[0]
@@ -350,6 +350,6 @@ func printDryRun(bucket, prefix string, started startedJSON, finished finishedJS
350350
// attestation.AttestationFilename. Tracking issue: NVIDIA/aicr#1267.
351351
// When implemented, parse failures must NOT be swallowed the same way —
352352
// only a genuinely absent attestation file should fall back to empty strings.
353-
func readPointerFromAttestation(_ string) (*attestation.Pointer, error) {
353+
func readPointerFromAttestation(_ string) (*attestation.Pointer, error) { //nolint:staticcheck // SA4023: unconditional error is the stub's documented behavior until #1267 lands
354354
return nil, errors.New(errors.ErrCodeInternal, "signer extraction not yet implemented")
355355
}

0 commit comments

Comments
 (0)