Skip to content

Conversation

@l50
Copy link

@l50 l50 commented Aug 17, 2025

Problem:

  • Package installation failed with "invalid char ' '" errors due to improper whitespace handling
  • Complex sed regex patterns were fragile and hard to maintain
  • Duplicated environment setup code for go install vs go get

Solution:

  • Simplified comment parsing using bash pattern matching for full-line comments
  • Added explicit whitespace trimming with xargs after removing inline comments
  • Consolidated go command execution using array for proper argument handling
  • Use separate variable for package installation to avoid mutating display name

Changes:

  • Replace complex sed patterns with simpler, more robust parsing logic
  • Use bash array for go_cmd to properly handle "get -u" as separate arguments
  • Add stderr redirection (2>&1) for proper error capture
  • Fix typo: "donwload" -> "download"
  • Consolidate duplicate GOROOT/GOPATH/PATH setup

Impact:


Note

Refactors bin/install to robustly parse package lines and unify Go package installation with a single execution path and shared env setup.

  • bin/install:
    • Package parsing in install_default_go_pkgs:
      • Skip empty/comment lines; strip inline comments and trim whitespace.
    • Install execution:
      • Use go_cmd array and pkg_to_install (preserve display name; append @latest when needed).
      • Consolidate go install/go get -u into a single execution block with shared env and stderr redirection.
    • Misc: Fix typo "donwload" -> "download".

Written by Cursor Bugbot for commit e164f0f. This will update automatically on new commits. Configure here.

**Problem:**
- Package installation failed with "invalid char ' '" errors due to improper whitespace handling
- Complex sed regex patterns were fragile and hard to maintain
- Duplicated environment setup code for go install vs go get

**Solution:**
- Simplified comment parsing using bash pattern matching for full-line comments
- Added explicit whitespace trimming with xargs after removing inline comments
- Consolidated go command execution using array for proper argument handling
- Use separate variable for package installation to avoid mutating display name

**Changes:**
- Replace complex sed patterns with simpler, more robust parsing logic
- Use bash array for go_cmd to properly handle "get -u" as separate arguments
- Add stderr redirection (2>&1) for proper error capture
- Fix typo: "donwload" -> "download"
- Consolidate duplicate GOROOT/GOPATH/PATH setup

**Impact:**
- Fixes installation failures for packages in .default-golang-pkgs
- Supports comments and various whitespace formatting in package files
- More maintainable code
@l50
Copy link
Author

l50 commented Oct 14, 2025

Anything I can do to unblock this?

@smorimoto
Copy link
Member

bugbot run

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no bugs!


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Issue: Default Go packages fail to install with "invalid char ' '" error

2 participants