Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create SingleTypeSubstitutionMangler #91

Merged
merged 1 commit into from
May 20, 2024

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
8 checks passed
@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