json
json copied to clipboard
Update to 1.19 golang version
I tested the empty struct and it worked. Code i used to test the code.
package main
import (
"fmt"
jsone "github.com/clarketm/json"
)
type Test struct {
Hello string `json:"hello,omitempty"`
User User `json:"user,omitempty"`
}
type User struct {
Str string `json:"str,omitempty"`
}
func main() {
var TestStr = Test{ User: User{ Str: ""}}
b, err := jsone.Marshal(TestStr)
if err != nil {
panic(err)
}
var mapSt map[string]any
if ers := jsone.Unmarshal(b, &mapSt); ers !=nil {
panic(ers)
}
fmt.Println(mapSt)
}