Skip to content

Comments

Create SingleTypeSubstitutionMangler#91

Merged
dfinkel merged 1 commit intomasterfrom
single_type_substitution_mangler
May 20, 2024
Merged

Create SingleTypeSubstitutionMangler#91
dfinkel merged 1 commit intomasterfrom
single_type_substitution_mangler

Conversation

@dfinkel
Copy link
Contributor

@dfinkel dfinkel commented May 17, 2024

Implement a Mangler implementation that takes two type-arguments that are directly convertible to convert to and from.

This will facilitate point-substituting time.Duration with a type that's also an int64, but has an UnmarshalJSON method that calls time.ParseDuration if it's passed a JSON string, and parses an integer as nanoseconds if passed a JSON integer/number. -- for use by the json and cue decoders.

Implement a Mangler implementation that takes two type-arguments that
are directly convertible to convert to and from.

This will facilitate point-substituting time.Duration with a type that's
also an int64, but has an `UnmarshalJSON` method that calls
`time.ParseDuration` if it's passed a JSON string, and parses an integer
as nanoseconds if passed a JSON integer/number. -- for use by the json
and cue decoders.
@dfinkel dfinkel merged commit e43afea into master May 20, 2024
@dfinkel dfinkel deleted the single_type_substitution_mangler branch May 20, 2024 17:47
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