Skip to content

Repository files navigation

json2go
-------

json2go provides a library and cli tool for converting json strings to go struct definitions.

library Usage:

    // with json tags
    code, err := json2go.Transform("User", `{"name": "Alice"}`, true)

    // without json tags
    code, err := json2go.Transform("User", `{"name": "Alice"}`, false)


cli interface:

    go install olexsmir.xyz/json2go/cmd/json2go@latest

    echo '{"id": 1, "name": "Alice"}' | json2go
    json2go '{"id": 1, "name": "Alice"}'
    json2go --help

About

convert json to go type annotations

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Used by

Contributors

Languages