<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>kiririmode</author_name>
  <author_url>https://blog.hatena.ne.jp/kiririmode/</author_url>
  <blog_title>理系学生日記</blog_title>
  <blog_url>https://kiririmode.hatenablog.jp/</blog_url>
  <categories>
    <anon>golang</anon>
  </categories>
  <description>ファイルを出力する機能のユニットテストを書く場合に、期待値としてのファイルと生成したファイルを比較し、差分があれば当該差分をきれいに表示したい場合があります。 これはgo-diffを利用することで可能になります。 例えば、以下のような形です。テストが落ちた時にどこがおかしいのか読みやすいですね。 上記を実現しているテストコードはこんな形です。 import ( &quot;testing&quot; // snip &quot;github.com/sergi/go-diff/diffmatchpatch&quot; ) (略) for _, f := range fileNames { expectedFilePath := fi…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fkiririmode.hatenablog.jp%2Fentry%2F20210304%2F1614869999&quot; title=&quot;Golangでファイル差分をわかりやすく表示する - 理系学生日記&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/k/kiririmode/20210307/20210307151848.png</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2021-03-04 23:59:59</published>
  <title>Golangでファイル差分をわかりやすく表示する</title>
  <type>rich</type>
  <url>https://kiririmode.hatenablog.jp/entry/20210304/1614869999</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
