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
feat: VSCode tools auto-install + go.mod version handling improvements (#554)
* [AB#542] Fix goenv vscode init
Currently goenv vscode init added a random json flag, and that's not correct. Clean up and remove the line from the JSON.
* feat: Add VSCode Go extension tools installation support
Add comprehensive VSCode tools management with automatic installation
support for all 8 required tools from the VSCode Go extension.
New Features:
- Add 'goenv tools install-vscode <version>' command to install all
VSCode Go extension tools (gopls, dlv, vscgo, goplay, gomodifytags,
impl, gotests, staticcheck)
- Add --install-tools flag to 'goenv vscode init' command
- Add --install-tools flag to 'goenv vscode setup' command
Bug Fixes:
- Fix vscgo package path to github.com/golang/vscode-go/vscgo
- Fix goplay package path to github.com/haya14busa/goplay/cmd/goplay
- Update documentation examples to use 'default-tools' instead of 'default'
- Fix test assertion to match new command name
Implementation Details:
- Add VSCodeTools list with all 8 required tools
- Add BuildVSCodeToolsConfig() helper for DRY configuration building
- Add InstallVSCodeToolsForVersion() shared installation logic
- Integrate tools installation into vscode init and setup workflows
Closes#542
* test: Add comprehensive tests for go.mod forward compatibility
Add test coverage for GetCurrentVersionResolved() with go.mod scenarios,
particularly for Go 1.26+ behavior where 'go mod init' defaults to (N-1).0.
Version selection strategy when go.mod is the version source:
• Lowest minor version that satisfies the constraint (most conservative)
• Highest patch of that minor (always want bug/security fixes)
Test scenarios include:
- PRIMARY: go.mod 1.25 + installed [1.25.4, 1.26.1, 1.27.0] → uses 1.25.4
(validates lowest satisfying minor, highest patch strategy)
- Forward compatibility: go.mod 1.25 with only newer minors (1.26+)
→ uses minimum compatible (e.g., 1.26.0 over 1.27.0)
- Highest patch preference: multiple patches of target minor available
→ always selects highest patch (e.g., 1.25.4 over 1.25.2)
- Backward incompatibility: go.mod 1.26 with only older versions
→ errors correctly (can't use older version)
- Edge cases: no versions installed, full version specs
This validates the existing forward compatibility logic in
GetCurrentVersionResolved() and findCompatibleVersion() that allows
users with go.mod requiring Go 1.25 to successfully use Go 1.26+
while preferring exact minor matches when available.
Related to issue #542 (go.mod version handling)
* fix: Make cache timing tests more robust for Windows CI
Increase TTL and sleep durations in TestCacheGetStats and TestCachePrune
to account for Windows timing precision and slower CI environments.
Before:
- TestCacheGetStats: 100ms TTL with 50ms + 60ms sleeps
- TestCachePrune: 50ms TTL with 60ms sleep
After:
- TestCacheGetStats: 200ms TTL with 50ms + 160ms sleeps
- TestCachePrune: 100ms TTL with 120ms sleep
This provides more margin for test execution overhead while maintaining
the same test logic and coverage.
0 commit comments