AES Encrypt & Decrypt
Encrypt text with a password using AES-GCM, and decrypt it back.
Generate Go structs with json tags from a sample payload.
Field names follow Go's initialism rules, so user_id becomes
UserID rather than UserId.
The JSON to Go Struct converter writes gofmt-aligned structs with json tags, exported field names that follow Go's initialism rules, and pointer types wherever a field can be absent or null.
Go needs a struct before it can unmarshal anything, and writing one by hand for a large response is tedious. Paste the JSON and get the structs, with the field names exported, the json tags carrying the original keys, and the declarations aligned the way gofmt would leave them.
The naming follows Go convention rather than a naive capitalisation: user_id becomes UserID, api_url becomes APIURL, and the other initialisms the style guide lists are uppercased too. Fields that are absent from some records or that appear as null are declared as pointers, which is how Go distinguishes a missing value from a zero one. There is an omitempty option for the structs you marshal back out.
user_id becomes UserID and api_url becomes APIURL, matching the style guide that linters such as golint enforce.
A *int64 that is nil means the key was absent; a plain int64 of 0 could mean either. The distinction is preserved.
Field names, types and tags are padded into columns exactly as gofmt would leave them, so the paste needs no reformatting.
Add the tag option in one click for structs that get marshalled back out and should omit their zero values.
Numbers are typed int64 and float64, because JSON routinely carries values beyond the 32-bit range.
An array of records produces better optional-field detection than a single object.
Nested structs are named from their keys automatically.
Add omitempty when the struct will be marshalled back to JSON.
Paste the result into a .go file — the declarations are already aligned.
Because Go cannot otherwise tell an absent field from a zero value. A *int64 that is nil means the key was missing; an int64 that is 0 could mean either.
The Go style guide says initialisms keep a consistent case, so ID, URL, API and HTTP are fully uppercase. Linters such as golint flag the alternative.
Because JSON numbers can exceed the 32-bit range and int is platform-sized. int64 is the safe default; narrow it by hand when you know the range.
They are generated as string, since that is what the JSON holds. Change the type to time.Time when the format is RFC 3339 — encoding/json parses that automatically.
What people who use the JSON to Go Struct think of it. Reviews come from visitors and are posted as written.
No ratings yet
Yours would be the first.
0 reviews
Newest first
No reviews yet
Be the first to rate the JSON to Go Struct. It takes half a minute and no account.
Write the first reviewEncrypt text with a password using AES-GCM, and decrypt it back.
AND, OR, XOR, shifts and rotates, at 8 to 64 bits, shown in binary.
Convert between JSON arrays and NDJSON, one compact document per line.
Turn a JSON object into a TOML document with proper tables and arrays of tables.
Beautify, minify and validate JSON with precise error locations.
Generate an MD5 hash of any text, with a straight answer about when not to.
Build layered box shadows visually, with a live preview.
Build a docker-compose.yml with databases, caches and health checks.