json icon indicating copy to clipboard operation
json copied to clipboard

Update to 1.19 golang version

Open mrredo opened this issue 1 year ago • 0 comments

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

mrredo avatar Oct 10 '22 16:10 mrredo