<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>otiai10</author_name>
  <author_url>https://blog.hatena.ne.jp/otiai10/</author_url>
  <blog_title>DRYな備忘録</blog_title>
  <blog_url>https://otiai10.hatenablog.com/</blog_url>
  <categories>
    <anon>go</anon>
  </categories>
  <description>tl;dr bufio.ScannerでScanが終わってもErrはちゃんと見ましょう。以上。 問題 継続的に書き込みのあるTCP接続からの読み込みを、bufio.Scannerをつかって華麗に逐次読み込みしていた。が、どうやらそれが静かに切断され、クライアント（こちら）側のローカルでの処理が先走っているように見える挙動があった。 res, err := ExecRemoteLongScript() defer res.Body.Close() scanner := bufio.NewScanner(res.Body) for scanner.Scan() { // do something …</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fotiai10.hatenablog.com%2Fentry%2F2018%2F01%2F23%2F121058&quot; title=&quot;【Go言語】bufio.Scannerの静かな突然死に3営業日ハマった - DRYな備忘録&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://images-fe.ssl-images-amazon.com/images/I/51lqgv%2BWyxL._SL160_.jpg</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2018-01-23 12:10:58</published>
  <title>【Go言語】bufio.Scannerの静かな突然死に3営業日ハマった</title>
  <type>rich</type>
  <url>https://otiai10.hatenablog.com/entry/2018/01/23/121058</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
