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

Support encoding/decoding structs to/from map #1

Open
robinheghan opened this issue Mar 7, 2018 · 0 comments
Open

Support encoding/decoding structs to/from map #1

robinheghan opened this issue Mar 7, 2018 · 0 comments

Comments

@robinheghan
Copy link

I'm sorry if this is already supported, but I couldn't see that from the docs.

Essentially, I want to code some arbitrary data to a transit map, without writing an encoder for it.

type Person struct {
    Name string
    Age int
}

encoded, err := transit.Marshall(&{"Robin", 28})
encoded == "["^ ","Name","Robin","Age",28]"

person := &Person{}
transit.Unmarshall(encoded, &person)
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