{"categories":["\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0","\u65e5\u8a18"],"provider_url":"https://hatena.blog","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2F0xf.hatenablog.com%2Fentry%2F2022%2F11%2F05%2F184045\" title=\"python\u306e\u30b8\u30a7\u30cd\u30ec\u30fc\u30bf\u7684\u306a\u66f8\u304d\u5473\u3092golang\u3067 - 0xf\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","type":"rich","title":"python\u306e\u30b8\u30a7\u30cd\u30ec\u30fc\u30bf\u7684\u306a\u66f8\u304d\u5473\u3092golang\u3067","blog_url":"https://0xf.hatenablog.com/","version":"1.0","description":"yield \u3067\u30b7\u30e5\u30c3\u3068\u3044\u3051\u308b\u308f\u3051\u3067\u306f\u306a\u3044\u306e\u3060\u304c channel \u3092\u8fd4\u305b\u3070\u3044\u3044\u304b? func each(s, e int) <-chan int { r := make(chan int) go func() { defer close(r) for i := s; i < e; i++ { r <- i } }() return r } func main() { for i := range each(10, 20) { fmt.Println(i) } } range \u306b channel \u3092\u6e21\u3059\u3068 close \u307e\u3067\u30a4\u30c6\u30ec\u30fc\u30c8\u3057\u3066\u304f\u308c\u308b\u3001\u3068\u3044\u3046\u30c7\u30b6\u30a4\u30f3\u306f\u3053\u3046\u4f7f\u3046\u3053\u3068\u3092\u60f3\u5b9a\u306f\u3057\u3066\u3044\u308b\u3093\u3060\u308d\u3046\u3002\u2026","blog_title":"0xf","width":"100%","author_url":"https://blog.hatena.ne.jp/ma2saka/","url":"https://0xf.hatenablog.com/entry/2022/11/05/184045","published":"2022-11-05 18:40:45","author_name":"ma2saka","provider_name":"Hatena Blog","image_url":null,"height":"190"}