Skip to content

fix(stack): preserve literal empty struct arguments - #98

Open
ViktorBystrov72 wants to merge 1 commit into
maruel:mainfrom
ViktorBystrov72:fix/empty-struct-arguments
Open

ViktorBystrov72 wants to merge 1 commit into
maruel:mainfrom
ViktorBystrov72:fix/empty-struct-arguments

Conversation

@ViktorBystrov72

Copy link
Copy Markdown

Source augmentation drops literal struct{} parameters because they have no stack words. A chan struct{} parameter is also displayed with an unknown element type, and treating the channel like an interface consumes the next argument's word.

Recognize literal empty struct types, render fixed empty struct arguments without consuming words, and consume one word for channel arguments. This preserves subsequent arguments in both aggregate-form and older flat-word stack traces.

Fixes #59.

Validation on Go 1.27.3:

  • Regression cases and an actual Go panic failed before the change with missing empty structs, unknown channel types, and a lost following integer; they pass after it.
  • Controls cover legacy string words, non-empty anonymous structs, and elided arguments.
  • make fix, make verify, make test, and make test-race passed, including coverage and benchmark smoke checks.

Signed-off-by: Виктор Быстров <anatema@bk.ru>
@codecov

codecov Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.2%. Comparing base (496cdd2) to head (b731ac9).
⚠️ Report is 18 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##            main     #98     +/-   ##
=======================================
- Coverage   83.4%   80.2%   -3.2%     
=======================================
  Files         12      23     +11     
  Lines       2768    2269    -499     
=======================================
- Hits        2308    1819    -489     
- Misses       399     450     +51     
+ Partials      61       0     -61     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

Empty structs aren't decoded correctly in function arguments.

1 participant