<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>Konboi</author_name>
  <author_url>https://blog.hatena.ne.jp/Konboi/</author_url>
  <blog_title>@Konboi memo</blog_title>
  <blog_url>https://konboi.hatenablog.com/</blog_url>
  <categories>
    <anon>Go</anon>
    <anon>flag</anon>
    <anon>コマンドラインツール</anon>
    <anon>golang</anon>
    <anon>cli</anon>
  </categories>
  <description>はじめに コマンドラインツールを作っていると同一オプションで複数の値を受け取りたい事があります 今回は -ignore hoge -ignore fuga の用に特定の文字列を結果から除きく ignore というオプション名で複数のStringを受け取りたい という事にします Goのflagが標準で提供しているもので複数の値を受け付けているのは flag.Args() だけで今回の要件は満たすことができません 無いなら作る では､どうするか flag には flag.Var() という flagで定義しているValueを引数にとるメソッドがあります flag.Value は type Valu…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fkonboi.hatenablog.com%2Fentry%2F2016%2F03%2F08%2F102051&quot; title=&quot;Goのflag package で同じオプション名で複数の値を受け取る - @Konboi memo&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>http://ecx.images-amazon.com/images/I/51UoREcNrnL.jpg</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2016-03-08 10:20:51</published>
  <title>Goのflag package で同じオプション名で複数の値を受け取る</title>
  <type>rich</type>
  <url>https://konboi.hatenablog.com/entry/2016/03/08/102051</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
