<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>TKDS</author_name>
  <author_url>https://blog.hatena.ne.jp/TKDS/</author_url>
  <blog_title>RAKUS Developers Blog | ラクス エンジニアブログ</blog_title>
  <blog_url>https://tech-blog.rakus.co.jp/</blog_url>
  <categories>
    <anon>Go</anon>
  </categories>
  <description>はじめに 新卒1年目のTKDSです！ 先日，Go言語でjsonで返すレスポンスを作る際，ゼロ値の場合の項目の出し分けを行いたい場面がありました． そこで，encoding/jsonでゼロ値の場合の項目の出し分けを行う方法を調査しました． はじめに 行いたいこと 1. 改変したいフィールドの型をany(interface{})にして，タグにomitemptyを指定する 2. encoding/json/v2 のomitzeroを使う． 3. MarshalJSON()メソッドを実装する. まとめ</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Ftech-blog.rakus.co.jp%2Fentry%2F20240215%2Fgo&quot; title=&quot; Go言語でゼロ値の場合の項目を出し分けする方法とは？ - RAKUS Developers Blog | ラクス エンジニアブログ&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url>https://cdn-ak.f.st-hatena.com/images/fotolife/t/tech-rakus/20240215/20240215145035.png</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2024-02-15 14:50:44</published>
  <title> Go言語でゼロ値の場合の項目を出し分けする方法とは？</title>
  <type>rich</type>
  <url>https://tech-blog.rakus.co.jp/entry/20240215/go</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
