JSON to Golang Struct

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.

Example
Input JSON:
{
  "name": "John Doe",
  "age": 30,
  "email": "john@example.com",
  "address": {
    "street": "123 Main St",
    "city": "New York",
    "zipcode": "10001"
  },
  "hobbies": ["reading", "swimming"]
}
Generated Struct (with omitempty):
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"`
}