Skip to content

maru44/gson

Repository files navigation

gson

You can use spread json tag by using this package.

Usage

Thanks

inspired by encoding/json https://github.com/golang/go/tree/master/src/encoding/json

Origin

ex)

type good[T any] struct {
    Name string
    Free T `json:"..."`
}

type more struct {
    Age int
    Country string
}

var foo = good[more]{
    Name: "Foo",
    more: more{
        Age: 20,
        Country: "U.S.A",
    },
}

If you encode it in json. It'll be like this.

{"Name": "Foo", "Age": 20, "Country": "U.S.A"}

golang/go#52138

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages