Инструмент Go, который генерирует структуры Go из нескольких объектов JSON или YAML.
go install github.com/twpayne/go-jsonstruct/v3/cmd/gojsonstruct@latest
{
"age": 37,
"user_height_m": 2
}
{
"age": 38,
"user_height_m": 1.7,
"favoriteFoods": [
"cake"
]
}
package main
type T struct {
Age int `json:"age"`
FavoriteFoods []string `json:"favoriteFoods,omitempty"`
UserHeightM float64 `json:"user_height_m"`
}
#golang #json #yaml
▪ Github
@golang_google
Please open Telegram to view this post
VIEW IN TELEGRAM
👍31❤6🔥5😁2🤬1