Skip to content

Add CommandError helper, Go 1.25, and linting improvements#4

Open
dustinblack wants to merge 5 commits into
inkel:mainfrom
arcalot:upstream-contributions
Open

Add CommandError helper, Go 1.25, and linting improvements#4
dustinblack wants to merge 5 commits into
inkel:mainfrom
arcalot:upstream-contributions

Conversation

@dustinblack

Copy link
Copy Markdown

Summary

  • Add CommandError(err, errMsg) function that returns a formatted error with stderr output appended when the error is an *exec.ExitError
  • Upgrade Go version from 1.17 to 1.25
  • Add .golangci.yaml with comprehensive linter configuration (golangci-lint v2 format)
  • Add .gitignore for standard Go build artifacts
  • Fix doc comments for Go conventions and godot compliance
  • Add //nolint:gosec annotations on Command and CommandContext for intentional variable argument execution

Details

CommandError helper

A convenience function for extracting and formatting stderr from failed command executions. Given an error and a message string, it:

  • Returns nil if err is nil
  • Returns a formatted error with stderr appended if the error is an *exec.ExitError with captured stderr
  • Returns a formatted error without stderr if stderr is not available

Doc comment fixes

  • Package comment now starts with Package exex per Go convention
  • Type alias comments (Error, ExitError) and String() now end with periods

Test plan

  • All existing tests pass (go test ./...)
  • Benchmarks remain intact and functional
  • Review CommandError behavior with nil error, ExitError with stderr, and ExitError without stderr

🤖 Generated with Claude Code

mfleader and others added 5 commits April 17, 2026 11:51
- Add standard Go .gitignore
- Fix package doc comment to use 'Package exex' convention
- Add trailing periods to doc comments for godot compliance

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Update Go version from 1.17 to 1.25
- Add .golangci.yaml with comprehensive linter configuration (v2 format)
- Add //nolint:gosec annotations on Command and CommandContext for
  intentional variable argument execution

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants