Re: [go-nuts] efficient way to csv.Reader() from a chan of string

2018-09-15 Thread Yannic Bonenberger
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

[go-nuts] Re: marshal and unmarshal

2017-11-18 Thread Yannic
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

[go-nuts] Re: Golang goroutine slow down when adding concurrency

2017-10-28 Thread Yannic
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