Paste your JSON object and click "Generate Struct" to get a Golang struct definition. Use the checkbox to include omitempty tags in the struct fields.
omitempty
{ "name": "John Doe", "age": 30, "email": "john@example.com", "address": { "street": "123 Main St", "city": "New York", "zipcode": "10001" }, "hobbies": ["reading", "swimming"] }
type Root struct { Name string `json:"name,omitempty"` Age int `json:"age,omitempty"` Email string `json:"email,omitempty"` Address Address `json:"address,omitempty"` Hobbies []string `json:"hobbies,omitempty"` } type Address struct { Street string `json:"street,omitempty"` City string `json:"city,omitempty"` Zipcode string `json:"zipcode,omitempty"` }