होम
Tom Utilities

JSON से Go स्ट्रक्ट

JSON टूल

JSON नमूने से नेस्टेड प्रकारों सहित JSON टैग वाले Go स्ट्रक्ट बनाएँ।

इनपुट

परिणाम

उपयोग कैसे करें

Generate Go structs

Paste a representative JSON object and run Convert. Field types are inferred from the sample values.

  1. Paste a JSON object.
  2. Click Convert.
  3. Copy the generated Go code.

Type inference

Whole numbers become int, decimals become float64, booleans become bool, strings become string and nested objects become named structs.

अक्सर पूछे जाने वाले प्रश्न

Why is a null field typed as interface{}?

A null value gives no type information, so the generator falls back to interface{}.

Does it handle arrays of objects?

Yes. Arrays become slices, and arrays of objects produce a nested struct type.

संबंधित टूल