<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>laplus-knsn</author_name>
  <author_url>https://blog.hatena.ne.jp/laplus-knsn/</author_url>
  <blog_title>at kaneshin</blog_title>
  <blog_url>https://kaneshin.hateblo.jp/</blog_url>
  <categories>
    <anon>Golang</anon>
  </categories>
  <description>Go言語でコマンドラインツールを作るときに入力を受け取るインターフェースでオプションや標準入力で受け付けることはあると思いますが、パイプで渡すことも考慮されているとクールなツールになるなと思っています。 標準入力の受け取り それぞれの実装方法は簡単です。 インタラクティブ var stdin string fmt.Scan(&amp;stdin) fmt.Println(stdin) インタラクティブに標準入力からデータを受け取るには fmt.Scan で入力待ちをします。このとき入力した値が渡した変数に格納されます。 パイプ body, err := ioutil.ReadAll(os.Stdin)…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fkaneshin.hateblo.jp%2Fentry%2F2016%2F07%2F05%2F004601&quot; title=&quot;Golangの標準入力をインタラクティブかパイプで入力を受け取る - at kaneshin&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>2016-07-05 00:46:01</published>
  <title>Golangの標準入力をインタラクティブかパイプで入力を受け取る</title>
  <type>rich</type>
  <url>https://kaneshin.hateblo.jp/entry/2016/07/05/004601</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
