all repos

json2go @ a1fb55e

convert json to go type annotations
name last commit last update
.github/ ci: fix goreleaser 4 months ago 2026-05-26 14:27:58 +0300
cmd/ refactor: use an actual parser instead of reflection 4 months ago 2026-05-26 14:07:11 +0300
testdata/ refactor: use an actual parser instead of reflection 4 months ago 2026-05-26 14:07:11 +0300
.goreleaser.yaml chore: setup goreleaser 10 months ago 2025-11-27 15:00:41 +0200
LICENSE chore: add license 10 months ago 2025-11-27 19:46:46 +0200
go.mod refactor: use an actual parser instead of reflection 4 months ago 2026-05-26 14:07:11 +0300
go.sum refactor: use an actual parser instead of reflection 4 months ago 2026-05-26 14:07:11 +0300
json2go.go refactor: use an actual parser instead of reflection 4 months ago 2026-05-26 14:07:11 +0300
json2go_bench_test.go refactor: use an actual parser instead of reflection 4 months ago 2026-05-26 14:07:11 +0300
json2go_test.go remove dead code 3 months ago 2026-07-11 14:04:12 +0300
lexer.go refactor: use an actual parser instead of reflection 4 months ago 2026-05-26 14:07:11 +0300
lexer_test.go refactor: use an actual parser instead of reflection 4 months ago 2026-05-26 14:07:11 +0300
parser.go refactor: use an actual parser instead of reflection 4 months ago 2026-05-26 14:07:11 +0300
parser_test.go refactor: use an actual parser instead of reflection 4 months ago 2026-05-26 14:07:11 +0300
readme.txt refactor: use an actual parser instead of reflection 4 months ago 2026-05-26 14:07:11 +0300
token.go refactor: use an actual parser instead of reflection 4 months ago 2026-05-26 14:07:11 +0300
token_type_string.go refactor: use an actual parser instead of reflection 4 months ago 2026-05-26 14:07:11 +0300
transpiler.go fix!: indentation 2 months ago 2026-07-12 13:02:52 +0300
transpiler_test.go refactor!: inline all nested types 3 months ago 2026-07-11 13:56:41 +0300
value.go refactor: use an actual parser instead of reflection 4 months ago 2026-05-26 14:07:11 +0300
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