Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/maru44/gson


https://github.com/maru44/gson

Last synced: 5 days ago
JSON representation

Awesome Lists containing this project

README

        

# 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)

```go
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"}
```

https://github.com/golang/go/issues/52138