Skip to content

Fixed generated unmarshalling of ints with custom types.#46

Closed
petermattis wants to merge 1 commit intogogo:masterfrom
petermattis:pmattis/int-customtype
Closed

Fixed generated unmarshalling of ints with custom types.#46
petermattis wants to merge 1 commit intogogo:masterfrom
petermattis:pmattis/int-customtype

Conversation

@petermattis
Copy link
Copy Markdown

Previously the generated code wouldn't even compile. Not sure if this is the right approach. Note that the Marshal and Unmarshal methods are never called for int wire types when using the generated marshaler and unmarshaler.

@awalterschulze
Copy link
Copy Markdown
Member

CustomType currently only works for bytes.
This is a good idea that has been discussed in these issues.
#28
#36
I would really love to have this done for all scenarios, since I believe customtype is very useful for more than just bytes.
Maybe you would like to join a discussion so that we first design a good solution for this problem.

PS
Please do not import other projects, even in tests.
I am trying to keep the dependencies to a minimum.

@awalterschulze
Copy link
Copy Markdown
Member

I think my main problem was something with NewPopulated.
I think I can probably just let go and do something more practical.

@petermattis
Copy link
Copy Markdown
Author

Oops, removed the usage of the cockroach/util package. That was just some copy&paste of existing code.

I'll add a comment to #36 which is the exact issue this PR is addressing.

@awalterschulze
Copy link
Copy Markdown
Member

Cool :)

On 16 April 2015 at 15:14, Peter Mattis notifications@github.com wrote:

Oops, removed the usage of the cockroach/util package. That was just some
copy&paste of existing code.

I'll add a comment to #36 #36
which is the exact issue this PR is addressing.


Reply to this email directly or view it on GitHub
#46 (comment).

@awalterschulze
Copy link
Copy Markdown
Member

I hope the proposed casttype will fix this issue for you?
#36

@awalterschulze
Copy link
Copy Markdown
Member

Please open again if you think this is still relevant.
You might be able to reuse some of this work if you would like to implement casttype.

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