Skip to content

Conversation

@fredbi
Copy link
Member

@fredbi fredbi commented Jan 4, 2026

Change type

Please select: 🆕 New feature or enhancement|🔧 Bug fix'|📃 Documentation update

Short description

Fixes

Full description

Checklist

  • I have signed all my commits with my name and email (see DCO. This does not require a PGP-signed commit
  • I have rebased and squashed my work, so only one commit remains
  • I have added tests to cover my changes.
  • I have properly enriched go doc comments in code.
  • I have properly documented any breaking change.

fredbi added 3 commits January 4, 2026 10:55
Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
This is inspired by stretchr#1829,
but we proceed differently, not checking for a string type but for
type convertibility to a time instead.

Added more tests to check how embedded types, pointers etc actually render and don't cause
panic.

From the original issues:

* fixes stretchr#1078
* fixes stretchr#1079

Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
@codecov
Copy link

codecov bot commented Jan 4, 2026

Codecov Report

❌ Patch coverage is 84.04255% with 15 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.21%. Comparing base (c889903) to head (5319d1e).
⚠️ Report is 1 commits behind head on master.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
internal/spew/common.go 80.88% 9 Missing and 4 partials ⚠️
internal/spew/time.go 91.66% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master      #27      +/-   ##
==========================================
- Coverage   88.29%   88.21%   -0.08%     
==========================================
  Files          59       60       +1     
  Lines        7389     7467      +78     
==========================================
+ Hits         6524     6587      +63     
- Misses        725      735      +10     
- Partials      140      145       +5     

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

@fredbi fredbi merged commit a77bd23 into go-openapi:master Jan 4, 2026
23 checks passed
@fredbi fredbi deleted the fix/1078-rendering-time-diff branch January 4, 2026 14:16
Copy link

@ccoVeille ccoVeille left a comment

Choose a reason for hiding this comment

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

Apparently you already merged

}

// stringizeWants converts a slice of wanted test output into a format suitable
// stringizeWants verts a slice of wanted test output into a format suitable

Choose a reason for hiding this comment

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

This change looks weird

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah. Typo. Will do. Thank

}

defer catchPanic(w, v)
handled, continued := handleErrorOrStringer(cs, w, v)

Choose a reason for hiding this comment

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

I feel like the first commit 9dae2c7 and this could be in a separate PR. I think you are fixing things that aren't related to time.Time

Copy link
Member Author

Choose a reason for hiding this comment

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

this stems from various issues I've faced while testing. My initial scope for testing was larger and uncovered issues with the "unsafe" transform. I agree that these should be address separately.

Copy link
Member Author

@fredbi fredbi Jan 4, 2026

Choose a reason for hiding this comment

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

I am currently researching a more systematic way to uncover robustness issues in spew. There are ways too
many ways to panic or hang it at this moment.

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