Skip to content

fix: handle nil message return in internalGo function and add tests f… - #16

Merged
kazeburo merged 2 commits into
mainfrom
fix/run-return-nil
Aug 19, 2026
Merged

fix: handle nil message return in internalGo function and add tests f…#16
kazeburo merged 2 commits into
mainfrom
fix/run-return-nil

Conversation

@kazeburo

@kazeburo kazeburo commented Aug 19, 2026

Copy link
Copy Markdown
Member

User description

…or error message type


PR Type

Bug fix, Tests


Description

  • Safely handle nil runner messages.

  • Preserve exit codes for typed nil returns.

  • Add reusable tests for any and error.


Diagram Walkthrough

flowchart LR
  Runner["Runner returns message and code"]
  NilCheck["Validate nil message value"]
  Result["Return empty message with code"]
  Format["Format non-nil message"]
  Runner -- "provides result" --> NilCheck
  NilCheck -- "nil" --> Result
  NilCheck -- "non-nil" --> Format
Loading

File Walkthrough

Relevant files
Bug fix
flagrun.go
Handle nil messages from generic runners                                 

flagrun.go

  • Detect invalid and typed nil runner messages using reflection.
  • Return an empty message while preserving the runner exit code.
  • Avoid formatting nil values as .
+12/-0   
Tests
flagrun_go_test.go
Test nil error runner message handling                                     

flagrun_go_test.go

  • Add an error-typed runner that returns nil on success.
  • Extract shared message-type test cases into a generic helper.
  • Verify nil error messages return an empty string.
+24/-4   

@github-actions

github-actions Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

PR Reviewer Guide 🔍

(Review updated until commit 391aa80)

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 PR contains tests
🔒 No security concerns identified
⚡ No major issues detected

Comment thread flagrun.go Outdated
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@sonarqubecloud

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown
Contributor

Persistent review updated to latest commit 391aa80

@github-actions

Copy link
Copy Markdown
Contributor

PR Code Suggestions ✨

No code suggestions found for the PR.

@kazeburo
kazeburo merged commit d7556de into main Aug 19, 2026
3 checks passed
@kazeburo
kazeburo deleted the fix/run-return-nil branch August 19, 2026 22:55
@github-actions github-actions Bot mentioned this pull request Aug 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant