Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to 1.19 golang version #8

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

Conversation

mrredo
Copy link

@mrredo mrredo commented Oct 10, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant