<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>zetamatta</author_name>
  <author_url>https://blog.hatena.ne.jp/zetamatta/</author_url>
  <blog_title>標準愚痴出力</blog_title>
  <blog_url>https://zetamatta.hatenablog.com/</blog_url>
  <categories>
    <anon>go</anon>
  </categories>
  <description>既存のライブラリに bufio.Scanner があるが、改行をカットしてしまう 改行を含めて読み取りたいときは (*bufio.Reader) ReadString('\n') を使う EOF を検出した時の処理が面倒だが、雑に書くと最終行が失われてしまう 面倒なく、ありのままに読み込むコードを楽に書くための iterator を書いた foo.go package main import ( &quot;bufio&quot; &quot;fmt&quot; &quot;io&quot; &quot;os&quot; ) func readlines(r io.Reader) func(func(string, error) bool) { return func(y…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fzetamatta.hatenablog.com%2Fentry%2F2024%2F03%2F13%2F224735&quot; title=&quot;rangefunc の練習：Yet Another Scanner - 標準愚痴出力&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>2024-03-13 22:47:35</published>
  <title>rangefunc の練習：Yet Another Scanner</title>
  <type>rich</type>
  <url>https://zetamatta.hatenablog.com/entry/2024/03/13/224735</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
