<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>lufiabb</author_name>
  <author_url>https://blog.hatena.ne.jp/lufiabb/</author_url>
  <blog_title>Plan 9とGo言語のブログ</blog_title>
  <blog_url>https://blog.lufia.org/</blog_url>
  <categories>
    <anon>Go</anon>
  </categories>
  <description>以前からずっとある方法だけど、関数の内部で xxxInternal という形で実装を分けて、単体テストでは xxxInternal を使ってテストする書き方を気に入っています。どういうことかといえば、例えばKinesisにPutする以下のようなメソッドがあったとき、 type Writer struct{ ... } func (w *Writer) BulkPost(ctx context.Context, metrics []*Metric) error { k := kinesisFromConfig(w) // Kinesisを初期化する records := make([]types…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.lufia.org%2Fentry%2F2025%2F04%2F16%2F211534&quot; title=&quot;Goで気に入っているテストの書き方と関数をモックするjest.fnのようなライブラリを作った話 - Plan 9とGo言語のブログ&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>2025-04-16 21:15:34</published>
  <title>Goで気に入っているテストの書き方と関数をモックするjest.fnのようなライブラリを作った話</title>
  <type>rich</type>
  <url>https://blog.lufia.org/entry/2025/04/16/211534</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
