-
-
Notifications
You must be signed in to change notification settings - Fork 176
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
I cut structures for readability. It works with "encoding/json", but panics with "github.com/goccy/go-json"
package main
import (
"github.com/goccy/go-json"
)
// "encoding/json"
// "github.com/goccy/go-json"
type Auth struct {
Id int `json:"id"`
Login string `json:"login"`
CurrentOrganization *CurrentOrganization `json:"organization,omitempty" db:"organization"`
}
type CurrentOrganization struct {
Id int `json:"id"`
}
type User struct {
Auth
}
type AddUser struct {
User
}
func main() {
user := new(AddUser)
user.Login = "user756"
jsonUser, err := json.Marshal(user)
if err != nil {
println("error:", err.Error())
}
println("user:", jsonUser)
}
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working