Skip to content

Comments

[LFXV2-1087] Update survey service with Go 1.26 modernization and GitHub Actions versions#5

Merged
andrest50 merged 2 commits intomainfrom
andrest50/go-fix
Feb 17, 2026
Merged

[LFXV2-1087] Update survey service with Go 1.26 modernization and GitHub Actions versions#5
andrest50 merged 2 commits intomainfrom
andrest50/go-fix

Conversation

@andrest50
Copy link
Contributor

@andrest50 andrest50 commented Feb 17, 2026

Summary

This PR applies Go 1.26 code modernizations and updates GitHub Actions workflows to latest stable versions.

Ticket

LFXV2-1087

Changes

Go 1.26 Modernization

Applied go fix ./... to modernize code patterns identified by Go 1.26:

  • Replace strings.HasPrefix + strings.TrimPrefix pattern with strings.CutPrefix
  • Remove unnecessary loop variable captures (no longer needed in Go 1.22+)
  • Apply automatic formatting fixes

Files Modified:

  • internal/infrastructure/idmapper/nats_mapper.go - Use strings.CutPrefix for error message parsing
  • internal/service/survey_service.go - Remove loop variable captures
  • pkg/concurrent/workerpool.go - Remove loop variable captures

GitHub Actions Updates

Updated all workflow files to use latest stable versions with security-pinned commit hashes:

Updates:

  • actions/checkout: v6.0.0 → v6.0.2 (commit: de0fac2e4500dabe0009e67214ff5f5447ce83dd)
  • actions/setup-go: v6.0.0 → v6.2.0 (commit: 7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5)

Files Modified:

  • .github/workflows/ko-build-branch.yaml
  • .github/workflows/ko-build-main.yaml
  • .github/workflows/ko-build-tag.yaml
  • .github/workflows/mega-linter.yaml
  • .github/workflows/survey-api-build.yaml

New Features in Updated Actions:

  • Git user-agent improvements with orchestration ID (checkout)
  • Fixed tag handling (checkout)
  • Node.js updates and @actions/cache v5 upgrade (setup-go)

- Replace strings.HasPrefix + TrimPrefix with strings.CutPrefix
- Remove unnecessary loop variable captures (fixed in Go 1.22+)
- Fix struct field alignment formatting

Generated with Claude Code: https://claude.com/claude-code

Signed-off-by: Andres Tobon <andrest2455@gmail.com>
- Update actions/checkout to v6.0.2 (de0fac2e4500dabe0009e67214ff5f5447ce83dd)
- Update actions/setup-go to v6.2.0 (7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5)

Changes include:
- Git user-agent improvements with orchestration ID
- Fixed tag handling for checkout
- Node.js updates and @actions/cache v5 upgrade for setup-go

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Signed-off-by: Andres Tobon <andrest2455@gmail.com>
Copilot AI review requested due to automatic review settings February 17, 2026 21:00
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR aims to modernize the codebase for Go 1.26 (though go.mod indicates 1.25.4) and update GitHub Actions workflows to newer versions. However, the PR contains critical bugs in the Go modernization changes that will cause data corruption.

Changes:

  • Replace strings.HasPrefix + strings.TrimPrefix pattern with strings.CutPrefix in error handling
  • Remove loop variable captures in concurrent code paths
  • Update GitHub Actions versions (checkout, setup-go, cosign, docker-login, megalinter, ko-build)

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
internal/infrastructure/idmapper/nats_mapper.go Correctly modernizes error message parsing using strings.CutPrefix
internal/service/survey_service.go Critical bugs: Incorrectly removes loop variable captures for deferred closures in three mapping functions; also includes formatting alignment fixes
pkg/concurrent/workerpool.go Correctly removes loop variable capture for immediately-launched goroutines
.github/workflows/survey-api-build.yaml Updates actions/checkout to v6.0.2 and actions/setup-go to v6.2.0 with commit hashes
.github/workflows/mega-linter.yaml Updates actions/checkout to v6.0.2 and megalinter to v9.3.0
.github/workflows/ko-build-tag.yaml Updates actions/checkout to v6.0.2, actions/setup-go to v6.2.0, ko-build to v0.9, cosign to v3.0.3, and docker-login to v3.7.0
.github/workflows/ko-build-main.yaml Updates actions/checkout to v6.0.2, actions/setup-go to v6.2.0, and ko-build to v0.9
.github/workflows/ko-build-branch.yaml Updates actions/checkout to v6.0.2, actions/setup-go to v6.2.0 (ko-build already at v0.9)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@andrest50 andrest50 merged commit c8fccf9 into main Feb 17, 2026
10 of 11 checks passed
@andrest50 andrest50 deleted the andrest50/go-fix branch February 17, 2026 21:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants