You can use a bytes.Buffer to create a single csv.Reader and write the log
lines into that buffer.
The code will look roughly like this https://play.golang.org/p/gbCPwSsx5gy .
However, depending on the implementation of strings.Reader and the level of
optimization the Go compiler does, your appro
Your error can be easily fixed by writing []string{"xushiwei", "hughlv",
"pandaman", "guangsong"} instead of{"xushiwei", "hughlv", "pandaman",
"guangsong"} https://play.golang.org/p/XCg0_R7_ex
Also, please consider using https://play.golang.org to share code. It's
much easier for everyone.
On
You might want to take a look at this video https://youtu.be/ySy3sR1LFCQ which
shows some common issues with concurrency in go and how to use pprof and
the go tracer to inspect and fix them.
Hope this helps a bit.
Yannic
On Friday, October 27, 2017 at 2:38:00 PM UTC+2, Christian LeMoussel