<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>y-ni-shi</author_name>
  <author_url>https://blog.hatena.ne.jp/y-ni-shi/</author_url>
  <blog_title>yasu's blog</blog_title>
  <blog_url>https://y-ni-shi.hatenablog.com/</blog_url>
  <categories>
    <anon>Go</anon>
  </categories>
  <description>テスト時にエラーメッセージのバリデーション こういうケースはよくあると思いますが。 userDBに対してFind処理を行った際にエラーのチェックを行いたいケース。 _, err := user.FindUser(user) if err.Error() != &quot;user ID is invalid&quot; { t.Errorf(&quot;Error message is invalid: %v&quot;, err) } このようにError()でメッセージが取れるようです。 エラーメッセージのconst化 エラーメッセージは変わりやすいので、テストが壊れやすいです。 なので、それをconst値として公開しておくケー…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fy-ni-shi.hatenablog.com%2Fentry%2F2020%2F02%2F04%2F235143&quot; title=&quot;Goのエラーのメッセージを取得する - yasu&amp;#39;s 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></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2020-02-04 23:51:43</published>
  <title>Goのエラーのメッセージを取得する</title>
  <type>rich</type>
  <url>https://y-ni-shi.hatenablog.com/entry/2020/02/04/235143</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
