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

Provide more deccode context to the hooks #123

Closed
wants to merge 1 commit into from
Closed

Conversation

@bep
Copy link

@bep bep commented May 17, 2018

When decoding into a generic map (or a struct that contains a generic map) knowing the source's type information isn't enough information to do type conversions in a hook.

Adding the name improves this, as it makes it possible to create a "type converter registry".

Adding a new func type for this is unfortunate, but that is to preserver backwards compability.

benchmark              old ns/op     new ns/op     delta
Benchmark_Decode-4     6991          7183          +2.75%

benchmark              old allocs     new allocs     delta
Benchmark_Decode-4     51             54             +5.88%

benchmark              old bytes     new bytes     delta
Benchmark_Decode-4     1992          2088          +4.82%

Fixes #122

When decoding into a generic map (or a struct that contains a generic map) knowing the source's type information isn't enough information to do type conversions in a hook.

Adding the `name` improves this, as it makes it possible to create a "type converter registry".

Adding a new func type for this is unfortunate, but that is to preserver backwards compability.

```bash
benchmark              old ns/op     new ns/op     delta
Benchmark_Decode-4     6991          7183          +2.75%

benchmark              old allocs     new allocs     delta
Benchmark_Decode-4     51             54             +5.88%

benchmark              old bytes     new bytes     delta
Benchmark_Decode-4     1992          2088          +4.82%
```

Fixes #122
@bep
Copy link
Author

@bep bep commented Nov 14, 2018

I assume this library isn't actively maintained anymore?

@bep
Copy link
Author

@bep bep commented Sep 6, 2019

Having a spring clean of my old PRs that I assume will never be merged.

@bep bep closed this Sep 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

1 participant