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

Ability to name struct fields as, e.g. uint16 #159

Open
gobwas opened this issue Jul 13, 2016 · 0 comments
Open

Ability to name struct fields as, e.g. uint16 #159

gobwas opened this issue Jul 13, 2016 · 0 comments

Comments

@gobwas
Copy link

gobwas commented Jul 13, 2016

Hello!
Thank you for such super fast library 🚀

Lets say we have a struct:

type Pokemon struct {
    Name string
}

Generated code for which becomes:

// somewhere in (*Pokemon) {Unmarshal,Decode}Msg
switch msgp.UnsafeString(field) {
        case "Name":
                // ...

Could it become somehow to something like this?

type Pokemon struct {
    Name string `msg:"(uint)0x01"`
}
//...
// somewhere in (*Pokemon) {Unmarshal,Decode}Msg
switch binary.Uint16(field) {
        case 0x01:
                // ...
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

No branches or pull requests

1 participant