<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>ebi-yade</author_name>
  <author_url>https://blog.hatena.ne.jp/ebi-yade/</author_url>
  <blog_title>KAYAC Engineers' Blog</blog_title>
  <blog_url>https://techblog.kayac.com/</blog_url>
  <categories>
    <anon>golang</anon>
  </categories>
  <description>お久しぶりです。SRE の市川恭佑です。 今回は Go で CLI ツールを作成する際の小ネタを紹介します。 そもそも CLI パーサの選定 Go でコマンドを解析する手法は多岐に渡ります。そもそも標準 flag パッケージだけで実装することも可能ですし、spf13/cobra や urfave/cli をフラグパーサに採用することも多いかと思います。 好きなものを使っていただくのが一番ですが、今回の話題で取り上げる alecthomas/kong は、サブコマンドのサポートのみならず簡単な制約チェックも提供されているのが魅力的です。個人的には、不正なフラグが与えられたときに適切なエラーメッセ…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Ftechblog.kayac.com%2Fkong-version-flag&quot; title=&quot;【Go】kong で CLI のトップレベルに --version フラグを実装する - KAYAC Engineers&amp;#39; Blog&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://cdn-ak.f.st-hatena.com/images/fotolife/e/ebi-yade/20241027/20241027123603.png</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2024-10-30 12:00:00</published>
  <title>【Go】kong で CLI のトップレベルに --version フラグを実装する</title>
  <type>rich</type>
  <url>https://techblog.kayac.com/kong-version-flag</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
