You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor: enhance GetChecksum interface and remove unused internal methods
This commit improves the Tool interface design and removes unused code:
**Enhanced GetChecksum Interface:**
- Updated GetChecksum signature from (version, filename) to (version, cfg, filename)
- Provides tools access to full ToolConfig including distribution info and options
- Enables more efficient and context-aware checksum fetching
- Updated all tool implementations: JavaTool, GoTool, NodeTool, MavenTool, MvndTool
- Updated call sites in download.go and tests
**Removed Unused Internal Methods:**
- Removed getChecksumURL() from JavaTool, GoTool, NodeTool (not used)
- Removed getVersionsURL() from all tools (not used anywhere)
- Only kept getChecksumURL() in MavenTool and MvndTool where actually used
**Java Checksum Architecture Clarification:**
- Java checksums are handled during installation via getDownloadURLWithChecksum()
- GetChecksum() method returns informative error since checksums are pre-fetched
- Maintains existing efficient integration with Disco API during URL resolution
**Benefits:**
- Cleaner Tool interface with only necessary public methods
- More consistent and extensible GetChecksum signature
- Reduced code duplication and maintenance burden
- Better separation of concerns between installation-time and on-demand checksum fetching
All tests pass and functionality is preserved.
0 commit comments