Skip to content

[CI Failure Doctor] Investigate lint-go stringscut failure #17726

@github-actions

Description

@github-actions

CI Failure Investigation - Run #37390

Summary

golangci-lint failed in the lint-go job because pkg/workflow/known_needs_expressions.go still splits a needs.* expression with strings.Index, which triggers the modernize stringscut rule.

Failure Details

Root Cause Analysis

The lint-go job runs make golint, which invokes golangci-lint with the modernize suite that includes the stringscut check. The log shows pkg/workflow/known_needs_expressions.go:145:13: stringscut: strings.Index can be simplified using strings.Cut, so the linter exits with code 2 before any other checks run.

Failed Jobs and Errors

  • lint-gopkg/workflow/known_needs_expressions.go:145:13: stringscut: strings.Index can be simplified using strings.Cut (modernize)
Investigation Findings
  • Running make golint locally reproduces the failure because the stringscut rule is enabled by default in the lint configuration.
  • Swapping the strings.Index call for strings.Cut eliminates the warning without affecting the existing logic that drops post-activation needs expressions.
  • Attempts to run make fmt on the tree fail because go fmt ./... wants Go 1.25.0 but the download from proxy.golang.org is blocked, and forcing GOTOOLCHAIN=local runs against Go 1.24.12, which is below the module's go 1.25 requirement.

Recommended Actions

  • Re-run make golint on main after merging this change to confirm no other stringscut violations remain.

Prevention Strategies

Use strings.Cut (or other modern splitting helpers) whenever slicing needs.* expressions so the stringscut lint rule stays satisfied across the codebase.

AI Team Self-Improvement

Always prefer the Go 1.21+ helpers (e.g., strings.Cut) for substring extraction so modernization rules like stringscut do not break CI.

Historical Context

No prior CI Failure Doctor investigations matched this stringscut violation pattern.

🩺 Diagnosis provided by CI Failure Doctor

To install this workflow, run gh aw add githubnext/agentics/workflows/ci-doctor.md@ea350161ad5dcc9624cf510f134c6a9e39a6f94d. View source at https://github.com/githubnext/agentics/tree/ea350161ad5dcc9624cf510f134c6a9e39a6f94d/workflows/ci-doctor.md.

  • expires on Feb 23, 2026, 1:48 PM UTC

Metadata

Metadata

Labels

cookieIssue Monster Loves Cookies!

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions