a11y.skipToMainContent
1

JSON へ 行く Struct

JSON サンプルを貼り付けて、Go struct の定義をマッチングします。オプションの <code>json:"..."</code> タグ、<code>omitempty</code> と、nullable 値のポインタフィールドで取得します.

More options
Was this tool helpful?
Send output to:
Advertisement

How to use JSON to Go Struct

  1. JSON オブジェクトを貼り付ける(または Load サンプルをクリック).
  2. ルート struct 名 (デフォルト: Root) を選択します.
  3. Tick json struct タグ、 omitempty 、 または pointer-for-Optional を 欲しいなら .
  4. 生成されたGoコードをプロジェクトに直接コピーします.

JSON から Go Structとは?

サードパーティ製 API の手作業で指示書のボイラープレートを保存します。 ジェネレータはタイプ(int64, float64, bool, string)を継承し、オブジェクトの配列を含むすべてのネストオブジェクトのstructを再帰的に生成します。 json struct タグを追加して、Go's encoding/json パッケージマップフィールドを自動的に生成します。

Advertisement

FAQ

ネストされたオブジェクトはサポートされていますか?
はい。ネストされたオブジェクトはそれぞれ独自の型構造になります.
JSON はどこにでもアップロードされますか?
いいえ。 変換はブラウザで完全に実行されます。 サーバに送られるものはありません.

Related tools

Author

MW
Marcus Webb"The DevTool Craftsman"

Full-Stack Developer & Tools Architect

Marcus has been writing code since the dial-up era. He has contributed to open-source developer tools, built CI/CD pipelines for startups, and debugged production incidents at 3 AM more times than he would like to admit. His philosophy is that the best developer tool is the one that gets out of your way, and he writes about practical tooling that helps teams ship faster with fewer headaches.

← Back to Developer Tools · All tags

Last updated:

Advertisement