Skip to content

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

Open
@gobwas

Description

@gobwas

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:
                // ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions