今日たまたま見つけた gotest というプログラムの修正を行った際にドハマリした。 GitHub - rakyll/gotest: go test with colors https://github.com/rakyll/gotest gotest は go test の出力の PASS や FAIL といった定型の文字列を見つけて緑や赤に色付けする小さなプログラム。仕組みも簡単で以下の様なコードになっている。 func main() { setPalette() enableOnCI() gotest(os.Args[1:]) } func gotest(args []string) { r, w := io.Pipe() defer w.Close() args = append([]string{"test"}, args...) cmd := exec.Command("go"
![Big Sky :: goroutine でドハマリした。](https://cdn-ak-scissors.b.st-hatena.com/image/square/ae5f360d3c82cd87e23b34fb6f5013ab7cf0f1a6/height=288;version=1;width=512/https%3A%2F%2Fmattn.kaoriya.net%2Fimages%2Flogo.png)