Skip to content

fix: ensure replaced modules are required in go.mod during build #119

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

andypost
Copy link

When using the --replace flag, the build process was skipping go get for replaced modules but not adding them as requirements, causing Go compilation errors. This fix ensures replaced modules are properly required using go mod edit -require with placeholder versions.

Fixes #87

🤖 Generated with Claude Code

- Add CLAUDE.md with project overview and key commands for AI assistance
- Create docs/architecture/ with detailed architectural analysis:
  * ARCHITECTURAL_PATTERNS.md: 16 design patterns, anti-patterns, and 15 improvement suggestions
  * LOGGING_ARCHITECTURE.md: Analysis of sophisticated dual logging system (Log() vs Term())
  * PLUGIN_SYSTEM.md: Complete plugin architecture guide with examples
  * SERVICE_SYSTEM.md: Service-oriented design and dependency injection documentation
- Add comprehensive DEVELOPER_GUIDELINES.md covering:
  * Code style and conventions
  * Architecture guidelines and best practices
  * Logging guidelines for dual system usage
  * Plugin and service development guides
  * Testing, error handling, and performance considerations
- Update docs/README.md with improved organization and navigation

Total: 1,915 lines of comprehensive documentation covering system architecture,
development practices, and contribution guidelines.

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

Co-Authored-By: Claude <[email protected]>
andypost and others added 3 commits June 25, 2025 22:09
- Fix plugin download logic to properly distinguish between exact matches and subpaths
- Add two-phase approach: skip subpaths, handle exact matches as replaced modules
- Ensure replaced modules (both core and plugins) are required in go.mod with placeholder versions

The key fix changes the condition from `strings.HasPrefix(p.Path, repl)` to
`p.Path \!= repl && strings.HasPrefix(p.Path, repl)` to avoid incorrectly
skipping plugins that exactly match replaced module paths.

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

Co-Authored-By: Claude <[email protected]>
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.

Build a binary with --replace doesn't work
1 participant