Skip to content

zapcore: fix DurationEncoder.UnmarshalText doc comment#1556

Open
sueun-dev wants to merge 1 commit into
uber-go:masterfrom
sueun-dev:fix-durationencoder-unmarshaltext-doc
Open

zapcore: fix DurationEncoder.UnmarshalText doc comment#1556
sueun-dev wants to merge 1 commit into
uber-go:masterfrom
sueun-dev:fix-durationencoder-unmarshaltext-doc

Conversation

@sueun-dev

Copy link
Copy Markdown

The doc comment on DurationEncoder.UnmarshalText says anything other than "string" unmarshals to NanosDurationEncoder, but the switch defaults to SecondsDurationEncoder and also handles "nanos" and "ms" explicitly.

TestDurationEncoders already pins the actual behavior: "" and "something-random" serialize to 1.0000005 (seconds), not int64(1000000500) (nanos).

Updated the comment to list all four cases, matching the existing TimeEncoder.UnmarshalText doc in the same file. Comment-only change, no behavior change.

@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

Development

Successfully merging this pull request may close these issues.

2 participants