Skip to content

feat: add Equal method and AppendText support#6

Merged
min0625 merged 1 commit into
mainfrom
feat/add-equal-and-appendtext
Jun 23, 2026
Merged

feat: add Equal method and AppendText support#6
min0625 merged 1 commit into
mainfrom
feat/add-equal-and-appendtext

Conversation

@min0625

@min0625 min0625 commented Jun 23, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add TimeZone.Equal to compare two values by IANA name. A TimeZone holds a *time.Location and time.LoadLocation returns a distinct pointer on each call, so == is unreliable for non-zero values. Equal compares via String(), which preserves the UTC-as-zero-value invariant.
  • Implement encoding.TextAppender via AppendText; MarshalText now delegates to it, removing duplication. (TextAppender is Go 1.24+, which the project already targets.)
  • Add the encoding.TextAppender compile-time interface assertion.

Tests

  • Table-driven, parallel, black-box tests for Equal and AppendText.
  • Runnable Example tests for both.
  • make test and make lint pass.

🤖 Generated with Claude Code

Add TimeZone.Equal for comparing two values by IANA name, since a
TimeZone holds a *time.Location and time.LoadLocation returns a distinct
pointer per call, making == unreliable for non-zero values.

Implement encoding.TextAppender via AppendText and have MarshalText
delegate to it, removing duplication. Add table-driven tests and
runnable examples for both.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@codecov

codecov Bot commented Jun 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@min0625 min0625 merged commit 696612e into main Jun 23, 2026
6 checks passed
@min0625 min0625 deleted the feat/add-equal-and-appendtext branch June 23, 2026 05:20
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.

1 participant