{"categories":["Go","Golang"],"provider_url":"https://hatena.blog","blog_url":"https://blog.framinal.life/","type":"rich","published":"2022-08-20 15:04:35","provider_name":"Hatena Blog","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.framinal.life%2Fentry%2F2022%2F08%2F20%2F150435\" title=\" pflag \u304c\u3069\u306e\u3088\u3046\u306b args \u3092\u53d6\u5f97\u3057\u3066\u3044\u308b\u306e\u304b\u3092\u8ffd\u3046 - \u30d5\u30e9\u30df\u30ca\u30eb\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","image_url":"https://cdn-ak.f.st-hatena.com/images/fotolife/l/lirlia/20220820/20220820144721.png","width":"100%","author_name":"lirlia","author_url":"https://blog.hatena.ne.jp/lirlia/","height":"190","description":"Go \u306e pflag \u30d1\u30c3\u30b1\u30fc\u30b8\u3063\u3066\u3069\u3046\u3084\u3063\u3066\u5f15\u6570\u3092\u51e6\u7406\u3057\u3066\u308b\u3093\u3060\u308d\u3046\u304c\u6c17\u306b\u306a\u3063\u305f\u306e\u3067\u3001\u3061\u3087\u3063\u3068\u8abf\u3079\u3066\u307f\u307e\u3057\u305f\u3002 \u5f15\u6570\u3092\u914d\u5217\u306b\u3057\u3066\u8fd4\u3059\u3060\u3051\u306e\u30b3\u30fc\u30c9\u3092\u66f8\u3044\u3066\u307f\u307e\u3059\u3002 package main import ( \"fmt\" flag \"github.com/spf13/pflag\" ) type Args struct { Paths []string } func main() { args := Args{} // os.Args[1:] \u3092\u53d6\u5f97\u3057\u3066\u3001\u30d5\u30e9\u30b0\u3092\u89e3\u6790\u3057\u3066\u3044\u307e\u3059\u3002 // \u3053\u308c\u3088\u308a\u524d\u306b\u30d5\u30e9\u30b0\u306e\u30bb\u30c3\u30c8\u3092\u7d42\u3048\u308b\u5fc5\u8981\u304c\u3042\u308b flag.Parse() args.Paths = flag.Ar\u2026","title":" pflag \u304c\u3069\u306e\u3088\u3046\u306b args \u3092\u53d6\u5f97\u3057\u3066\u3044\u308b\u306e\u304b\u3092\u8ffd\u3046","version":"1.0","blog_title":"\u30d5\u30e9\u30df\u30ca\u30eb","url":"https://blog.framinal.life/entry/2022/08/20/150435"}