Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/maru44/gson
https://github.com/maru44/gson
Last synced: 5 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/maru44/gson
- Owner: maru44
- License: bsd-3-clause
- Created: 2022-04-06T12:02:00.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2022-04-06T12:56:54.000Z (over 2 years ago)
- Last Synced: 2024-06-19T19:37:03.169Z (7 months ago)
- Language: Go
- Size: 36.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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