Skip to content

fix: handle typed nil Stringers in ToStringE - #354

Open
deepakganesh78 wants to merge 1 commit into
spf13:masterfrom
deepakganesh78:fix/issue227-nil-stringer
Open

fix: handle typed nil Stringers in ToStringE#354
deepakganesh78 wants to merge 1 commit into
spf13:masterfrom
deepakganesh78:fix/issue227-nil-stringer

Conversation

@deepakganesh78

Copy link
Copy Markdown

Summary

  • avoid calling String on typed nil pointer values implementing fmt.Stringer
  • reuse the existing pointer-indirection helper without changing non-nil Stringer behavior
  • cover custom pointer Stringers, *time.Time, and panic propagation from non-nil Stringers

Tests

  • go test -shuffle on -v ./...
  • go vet ./...
  • golangci-lint run --new-from-rev=origin/master

Fixes #227

Avoid invoking String on typed nil pointer values while preserving the existing behavior for non-nil Stringers.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

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.

Bug or bad entry ?

2 participants