-
-
Notifications
You must be signed in to change notification settings - Fork 100
Open
Description
Description
When installing Go via asdf with a .default-golang-pkgs file, package installation fails with errors like:
Installing github.com/magefile/mage go pkg...
go: github.com/magefile/mage @latest: malformed module path "github.com/magefile/mage ": invalid char ' '
FAIL
Steps to Reproduce
- Create a
~/.default-golang-pkgsfile like this:
// Build & Development Tools
github.com/magefile/mage // Alternative to make
// VSCode Go Extension Tools
golang.org/x/tools/gopls // Go language server
golang.org/x/tools/cmd/goimports // Format and manage imports
golang.org/x/lint/golint // Go linter
github.com/cweill/gotests/gotests // Generate tests
github.com/fatih/gomodifytags // Modify struct tags
github.com/josharian/impl // Generate interface implementations
github.com/haya14busa/goplay/cmd/goplay // Go playground client
github.com/go-delve/delve/cmd/dlv // Go debugger
- Install Go using asdf:
asdf install golang 1.25.0- Observe installation failures for all packages
Expected Behavior
- Packages should install successfully
- Comments (both full-line and inline) should be properly ignored
- Whitespace should be handled correctly
Actual Behavior
- All package installations fail with "invalid char ' '" error
- Package names appear to have trailing spaces when passed to
go install
Root Cause
- The sed commands for parsing comments don't properly trim whitespace
- The package name variable is mutated when appending
@latest, potentially causing issues - Command execution for
go get -udoesn't properly handle multi-argument commands
Environment
- asdf-golang version: latest (commit 50c8f58, ~4 months old)
- Go version: 1.25.0
- OS: macOS
Proposed Fix
See PR #162 - Refactors package parsing logic to properly handle comments and whitespace, and fixes command execution using bash arrays.
Metadata
Metadata
Assignees
Labels
No labels