-
Notifications
You must be signed in to change notification settings - Fork 258
WIP: V3 - Initial Cut of Modernized Go version #479
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
AdamDrewsTR
wants to merge
122
commits into
go-nv:v3
Choose a base branch
from
AdamDrewsTR:go-go
base: v3
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
feat: Add version usage analysis and major UX enhancements
This massive update adds 7 new commands, enhances diagnostics, improves tool
management, and introduces version usage scanning to help users manage their
Go installations more effectively.
🎉 7 New Commands
1. goenv info - Detailed version information with lifecycle tracking
2. goenv compare - Side-by-side version comparison
3. goenv status - Quick installation health check
4. goenv setup - Automatic first-time configuration wizard
5. goenv get-started - Interactive beginner's guide
6. goenv explore - Command discovery by intent/category
7. goenv versions --used - Scan projects for version usage (🆕)
🔥 Doctor Improvements
- Interactive fix mode (--fix) - automatically repair issues
- 3 new diagnostic checks (shell environment, profile sourcing, duplicate
installations)
- 18 structured issue types with automated fixes
- Better UX (colors, emojis, clearer messages)
- Detects "undo sourcing" scenarios (major pain point)
🔍 Version Usage Analysis (New!)
- goenv versions --used - Scan current directory tree for version usage
- Shows which versions are used by projects (.go-version, go.mod)
- Helps identify versions safe to remove
- Depth control with --depth flag (default: 3 levels)
- Fast performance (<1s for typical project trees)
- Smart directory skipping (node_modules, .git, vendor, etc.)
📦 Tool Management Enhancements
- New commands: install, uninstall, list, status, outdated
- --all flag to operate across all Go versions
- Better tool consistency checking
- Improved sync capabilities
📦 +6 Internal Packages
- internal/lifecycle - Go version EOL tracking (1.12-1.25)
- internal/shellutil - Enhanced shell detection & management
- internal/utils/prompt.go - Interactive prompting system
- internal/utils/firstrun.go - First-run detection utilities
- internal/utils/output.go - Consistent output formatting
- internal/manager/scan.go - Project scanning for version analysis
…consolidation. - Added InteractiveSetup and AutoInstallSetup structs to handle user interactions and automatic installations. - Implemented version discovery from .go-version and go.mod files. - Added prompts for installation and VS Code settings updates. - Introduced WorkflowResult and AutoInstallResult types to encapsulate outcomes of the workflows. - Enhanced error handling and user feedback throughout the setup processes. refactor: Improve command execution in build-tool script - Replaced direct exec.Command calls with utility functions for better error handling and context management. - Updated platform checks to use the new platform package for OS detection. - Streamlined directory creation and permission setting with utility functions. fix: Optimize embedded version generation script - Refactored fetchReleases function to use a utility for fetching JSON with timeout. - Improved file size reporting after generating embedded versions. chore: Enhance swap script with platform-specific checks - Updated OS checks to utilize the platform package for better readability. - Refactored file existence checks and command executions to use utility functions. test: Add test utilities for easier test file handling - Introduced WriteTestFile and StripDeprecationWarning functions to simplify test setup and output processing.
…on support **Install command auto-detection:** - Detects version from .go-version in current directory or parents - Falls back to go.mod directive when no .go-version exists - Uses latest stable as final fallback - Explicit version arguments override auto-detection - Quiet mode suppresses all detection messages **Partial version resolution:** - `goenv install 1.21` resolves to latest 1.21.x (e.g., 1.21.13) - `goenv uninstall 1.22` intelligently handles multiple matches - Proper prefix matching prevents false matches (1.2 ≠ 1.21) **Uninstall improvements:** - Interactive selection when multiple versions match - `--all` flag to uninstall all matching versions - Non-interactive mode picks latest automatically - Smart version resolution with user feedback **Enhanced documentation:** - Updated COMMANDS.md with install auto-detection examples - Added troubleshooting and best practices - CI/CD integration examples - Security checksum verification guidance **Doctor command enhancements:** - Detects obsolete v3 environment variables (GOENV_PREPEND_GOPATH, etc.) - Checks for unnecessary PATH entries in Homebrew installations - Warns about stale configuration that could cause issues **Comprehensive test coverage:** - Auto-detection scenarios (7 test cases) - Partial version resolution (6 test cases) - Interactive vs non-interactive behavior - Multi-version uninstall workflows - Help text validation - Edge case prefix matching - Old `goenv install` behavior unchanged when explicit version provided - New auto-detection only activates when no version argument given - Uninstall now supports partial versions (previously required exact match)
- Introduced `goenv vscode setup` command for comprehensive setup, combining initialization, syncing, and validation. - Improved user experience by checking for Go extension settings and preventing PATH injection. - Added interactive prompts for auto-detecting VS Code workspace and configuring settings. - Implemented `goenv.autoSync` feature to automatically update VS Code settings when changing Go versions. - Updated documentation to reflect new commands and troubleshooting steps for common issues. - Added new troubleshooting guide for VS Code integration, addressing common problems and solutions. - Enhanced error handling and user feedback during configuration processes. - Introduced new internal functions for managing VS Code user settings and checking Go extension configuration.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Solves #480