Skip to content

Add some missing methods to the types in datetime#25826

Merged
jhendrixMSFT merged 8 commits intoAzure:mainfrom
jhendrixMSFT:azcore-datetime-cleanup
Jan 12, 2026
Merged

Add some missing methods to the types in datetime#25826
jhendrixMSFT merged 8 commits intoAzure:mainfrom
jhendrixMSFT:azcore-datetime-cleanup

Conversation

@jhendrixMSFT
Copy link
Copy Markdown
Member

@jhendrixMSFT jhendrixMSFT commented Jan 5, 2026

Added missing text (un)marshalers on some types so they're all uniform. Handle JSON nulls in JSON unmarshalers.
Cleaned up some missing punctuation in doc comments.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Jan 6, 2026

API Change Check

APIView identified API level changes in this PR and created the following API reviews

sdk/azcore

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR enhances the datetime package by adding missing text marshalers/unmarshalers to ensure all datetime types have consistent serialization support, and improves robustness by handling JSON null values in unmarshalers. It also cleans up documentation by adding missing punctuation to doc comments.

Key Changes

  • Added MarshalText and UnmarshalText methods to Unix and PlainDate types for consistency with other datetime types
  • Implemented JSON null handling across all UnmarshalJSON methods to prevent errors when deserializing null values
  • Fixed missing periods in doc comments for String, MarshalText, and UnmarshalText methods across multiple types

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
sdk/azcore/runtime/datetime/unix.go Added text marshaling methods, null handling, and refactored parsing logic into a shared helper function
sdk/azcore/runtime/datetime/unix_test.go Added comprehensive tests for new text marshaling methods and null handling
sdk/azcore/runtime/datetime/plain_date.go Added text marshaling methods, introduced jsonNull constant, and null handling in UnmarshalJSON
sdk/azcore/runtime/datetime/plain_date_test.go Added tests for text marshaling methods and null/empty input handling
sdk/azcore/runtime/datetime/plain_time.go Added null handling in UnmarshalJSON and fixed doc comment punctuation
sdk/azcore/runtime/datetime/plain_time_test.go Added tests for null and empty input handling
sdk/azcore/runtime/datetime/RFC3339.go Added null handling in UnmarshalJSON and fixed doc comment punctuation
sdk/azcore/runtime/datetime/RFC3339_test.go Replaced generic test with focused null handling test
sdk/azcore/runtime/datetime/RFC1123.go Added null handling in UnmarshalJSON and fixed doc comment punctuation
sdk/azcore/runtime/datetime/RFC1123_test.go Added test for JSON null handling

Comment thread sdk/azcore/runtime/datetime/plain_time_test.go Outdated
Comment thread sdk/azcore/runtime/datetime/plain_date_test.go Outdated
Comment thread sdk/azcore/runtime/datetime/plain_time_test.go Outdated
Comment thread sdk/azcore/runtime/datetime/unix.go
Comment thread sdk/azcore/runtime/datetime/plain_date.go Outdated
Comment thread sdk/azcore/runtime/datetime/RFC3339_test.go
Comment thread sdk/azcore/runtime/datetime/plain_date.go Outdated
Comment thread sdk/azcore/runtime/datetime/unix_test.go
Comment thread sdk/azcore/runtime/datetime/plain_date.go
Comment thread sdk/azcore/runtime/datetime/datetime.go Outdated
@jhendrixMSFT jhendrixMSFT force-pushed the azcore-datetime-cleanup branch from 716cb70 to 2086a8e Compare January 12, 2026 17:43
@jhendrixMSFT jhendrixMSFT merged commit 481e4ab into Azure:main Jan 12, 2026
11 checks passed
@jhendrixMSFT jhendrixMSFT deleted the azcore-datetime-cleanup branch January 12, 2026 17:58
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.

6 participants