Pin shfmt and goimports version to resolve Go version conflict#5365
Pin shfmt and goimports version to resolve Go version conflict#5365kadupoornima merged 3 commits intoGoogleCloudPlatform:developfrom
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses critical build failures caused by incompatible Go tool versions. It resolves these issues by explicitly pinning the versions of Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request effectively resolves the build failure by pinning shfmt and goimports to specific, compatible versions. This is a good immediate fix. My review includes suggestions to define these new version strings as variables in both the Makefile and the Dockerfile.precommit. This will improve maintainability by centralizing the version definitions and avoiding duplication, which is a good practice for managing dependencies.
d473900
into
GoogleCloudPlatform:develop
Build was failing with error:
mvdan.cc/sh/v3/cmd/shfmt@latest: mvdan.cc/sh/[email protected] requires go >= 1.25.0 (running go 1.24.6; GOTOOLCHAIN=local)Resolution:
Pinned
shfmtto the second-most recent version -go install mvdan.cc/sh/v3/cmd/[email protected]After this change, tested the docker build locally using the below command:
Got the this similar error:
39.37 go: golang.org/x/tools/cmd/goimports@latest: golang.org/x/[email protected] requires go >= 1.25.0 (running go 1.24.6; GOTOOLCHAIN=local)Made a similar change, pinned
golang.org/x/tools/cmd/goimportsversion tov0.42.0.Docker build successful.
Long term fix would be to upgrade the Go Environment to
Go 1.25. This would require updating Go versions across the entire repository to ensure consistency and can be taken up as a separate effort.