<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>i178inaba</author_name>
  <author_url>https://blog.hatena.ne.jp/i178inaba/</author_url>
  <blog_title>Technology Engineering</blog_title>
  <blog_url>https://inaba.hatenablog.com/</blog_url>
  <categories>
    <anon>Go</anon>
  </categories>
  <description>inabaです。 Go言語でstructをJSONにする時、ゼロ値を含まない場合はタグにomitemptyをつけますよね。 type stampCard struct { Stamp int `json:&quot;stamp,omitempty&quot;` } しかし、同じstructを使っている時にゼロ値を含む/含まないを切り替えたい時があります。 具体的には下記のようなstructです。 type stampCard struct { InStampRally bool `json:&quot;in_stamp_rally&quot;` Stamp int `json:&quot;stamp,omitempty&quot;` } 上記のstru…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Finaba.hatenablog.com%2Fentry%2F2017%2F01%2F31%2F023953&quot; title=&quot;【Go】structをJSONにする時、ゼロ値を含む/含まないを切り替える方法と注意点 #golang - Technology Engineering&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></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2017-01-31 02:39:53</published>
  <title>【Go】structをJSONにする時、ゼロ値を含む/含まないを切り替える方法と注意点 #golang</title>
  <type>rich</type>
  <url>https://inaba.hatenablog.com/entry/2017/01/31/023953</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
