all repos

json2go @ v0.1.1

convert json to go type annotations

json2go/readme.txt(view raw)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
json2go
-------

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

    t := json2go. NewTransformer()
    typedef, err := t.Transform(`{"json": true}`, "TypeName")


cli interface:

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

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