Re: [go-nuts] Re: How to implement this in golang?

2021-07-06 Thread Brian Candler
You haven't shown which lines 75, 76 and 83 correspond to. It's easier if you put the whole code on play.golang.org, and we'll be able to point to the error. But I'm guessing it's this: data := cmd.Stdout ... n := int(math.Min(float64(rand.Intn(len(data))), float64(len(data << line 75?

Re: [go-nuts] Re: How to implement this in golang?

2021-07-06 Thread LetGo
I think I made some progress I think. Is it right what I'm doing ? cmd.Stdin = conn // cmd.Stdout = conn // data := []byte(cmd.Stdout) data := cmd.Stdout var i int for { n := int(math.Min(float64(rand.Intn(len(data))), float64(len(data d

Re: [go-nuts] How I can see My Go code + Compiler generated Go source code -- before a point of assembly?

2021-07-06 Thread FallingFromBed
"...and I'm not really sure what you are looking for. C++ is a very complex language and does have many constructs that can be rewritten in simpler ways. Go is a much simpler language" Surely I say to Ian, if we have `var i interface{int(10)}` there must be some code generated to turn th

[go-nuts] Re: Finding a small memory leak

2021-07-06 Thread Anderson Queiroz
Hi, Christian, Whereas pprof seems to be the way to go, have you tried to plot a chart of memory usage over time? Depending where you're running it, it might me easy to get this info. Once I had to chase a small "CPU leak ", slowly over a long time (days-weeks) the program CPU consumption would