chore(go.mod): remove ineffective replace directives#1155
chore(go.mod): remove ineffective replace directives#1155joeykchen merged 1 commit intogoplus:devfrom
Conversation
As a library, spx's replace directives have no effect when imported by other Go programs, because spx is not the main module in that context. As documented in https://go.dev/ref/mod#go-mod-file-replace: > replace directives only apply in the main module's go.mod file and > are ignored in other modules. Signed-off-by: Aofei Sheng <aofei@aofeisheng.com>
Summary of ChangesHello @aofei, 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 streamlines the Go module configuration by removing Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. 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 correctly removes ineffective replace directives from the go.mod files. For a library project, these directives are ignored when the library is used as a dependency, so removing them makes the development environment better reflect how consumers will use the package. This change improves dependency management and helps prevent discrepancies between developer and consumer environments. The corresponding updates to go.sum are expected and correct. Overall, this is a good maintenance change.
There was a problem hiding this comment.
Pull request overview
This PR removes ineffective replace directives from go.mod files in the spx library. As documented in the Go modules reference, replace directives only apply in the main module's go.mod file and are ignored when spx is imported as a dependency by other Go programs.
Changes:
- Removed replace directives from the root go.mod file
- Removed replace directives from pkg/gdspx/cmd/codegen/go.mod
- Updated go.sum to reflect natural dependency resolution without replace overrides
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| go.mod | Removed 4 replace directives for golang.org/x/* packages |
| pkg/gdspx/cmd/codegen/go.mod | Removed 4 replace directives for golang.org/x/* packages |
| go.sum | Updated checksums to reflect natural dependency versions (golang.org/x/image v0.23.0, golang.org/x/mobile v0.0.0-20220518205345-8578da9835fd, and various transitive dependencies) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Code Review SummaryThe PR correctly removes ineffective replace directives from library modules. All automated checks pass and the changes align with Go module best practices. One area for consideration:
golang.org/x/image => golang.org/x/image v0.0.0-20210628002857-a66eb6448b8d
golang.org/x/mobile => golang.org/x/mobile v0.0.0-20210902104108-5d9a33257ab5While these are effective in a main module, they create version inconsistency with the rest of the codebase (which now uses newer versions). Consider updating |
As a library, spx's replace directives have no effect when imported by other Go programs, because spx is not the main module in that context.
As documented in https://go.dev/ref/mod#go-mod-file-replace: