Re: [go-nuts] Help with Go channels and select talk

2019-12-06 Thread robert engels
I’m sorry but your design is not comprehendible by me, and I’ve done lots of TCP based services. i think you only need to emulate classic TCP processing - a reader thread (Go routine) on each side of the connection using range to read until closed. The connection is represented by 2 channels

Re: [go-nuts] manifest file of releases

2019-12-06 Thread Wagner Riffel
On Thu Dec 5, 2019 at 8:27 AM wrote: > I would hope there would be a JSON file from which I could use to monitor > releases and obtain download URLs. Something similar to what CoreOS does: > https://coreos.com/releases/releases.json GET https://golang.org/dl/?mode=json, then your download link

Re: [go-nuts] Help with Go channels and select talk

2019-12-06 Thread Jason E. Aten
@Egon, I'm sure many here would jump in and assist, but you need to help us to help you by spelling out, specifically and exactly, the problem(s) you want solved. A few sentences on each challenge should suffice. -- You received this message because you are subscribed to the Google Groups

Re: [go-nuts] Help with Go channels and select talk

2019-12-06 Thread Egon Kocjan
Agreed, I see goroutines in general as a big win. But what I intend to talk about in the presentation: - we have two unidirectional flows of data resembling something like a TCP socket, easy to do with two goroutines with a for loop - let's add caching, so some requests do not go to the server -

[go-nuts] benchgraph: no data to show

2019-12-06 Thread Tong Sun
Oh, yeah, that's perfect. However, anyone get it working? I think I'm following the instruction correctly, however, whatever I tried, I always get no data to show error. I use benchgraph from latest git. Anyone able to get benchgraph from latest git working? Thx. On Friday, December 6,

Re: [go-nuts] Help with Go channels and select talk

2019-12-06 Thread robert engels
To clarify, with Go’s very lightweight threads it is “doing the multiplexing for you” - often only a single CPU is consumed if the producer and consumer work cannot be parallelized, otherwise you get this concurrency “for free”. You are trying to manually perform the multiplexing - you need

[go-nuts] getting a function docs when you have a *packages.Package

2019-12-06 Thread Dan Kortschak
I want to be able to extract function documentation in addition to a variety of other information. I have a *packages.Package from packages.Load. Is there an easy way to get the function documentation from this. At the moment I am obtaining a *doc.Package using the following code, but it seems

Re: [go-nuts] Plot Go's benchmark result

2019-12-06 Thread Sebastien Binet
there's this from Austin Clements: https://godoc.org/github.com/aclements/go-misc/benchplot On Fri, Dec 6, 2019 at 2:22 AM Tong Sun wrote: > Hi, > > Any existing tools out there that can turn Go's benchmark result from text > into chart? > > I'm looking for a simple/light-weighted solution,

Re: [go-nuts] Multiple processes in parallel for cgo service

2019-12-06 Thread Brian Candler
Can you just run multiple instances of your program, each independently fetching messages from SQS? -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to

[go-nuts] Re: Plot Go's benchmark result

2019-12-06 Thread Sean Liao
not sure if this fits https://github.com/codingberg/benchgraph On Friday, December 6, 2019 at 2:21:47 AM UTC+1, Tong Sun wrote: > > Hi, > > Any existing tools out there that can turn Go's benchmark result from text > into chart? > > I'm looking for a simple/light-weighted solution, like using

Re: [go-nuts] run queue length

2019-12-06 Thread Ian Lance Taylor
On Fri, Dec 6, 2019 at 11:29 AM Hochhaus, Andy wrote: > > I would like to export the runtime run queue length (as can be seen using "go > tool trace") to our monitoring infrastructure but I am unable to find a way > to access it using the runtime package without traces enabled. Is the run >

[go-nuts] Re: Inconsistent rounding with float printf ?

2019-12-06 Thread cratermoon
https://play.golang.org/p/j5HKxitS-Z6 See https://0.30004.com/ On Friday, December 6, 2019 at 1:25:01 AM UTC-8, Christophe Meessen wrote: > > I have noticed that printf performs an apparently inconsistent rounding of > floating point values. > > I divide a big number by 1000 and

[go-nuts] run queue length

2019-12-06 Thread Hochhaus, Andy
Hello, I would like to export the runtime run queue length (as can be seen using "go tool trace") to our monitoring infrastructure but I am unable to find a way to access it using the runtime package without traces enabled. Is the run queue length accessible from application code? -Andy -- You

Re: [go-nuts] Help with Go channels and select talk

2019-12-06 Thread Robert Engels
A channel is much closer to a pipe. There are producers and consumers and these are typically different threads of execution unless you have an event based (async) system - that is not Go. > On Dec 6, 2019, at 9:30 AM, Egon Kocjan wrote: > >  > There are goroutines in the examples of

Re: [go-nuts] Re: Inconsistent rounding with float printf ?

2019-12-06 Thread Jan Mercl
On Fri, Dec 6, 2019 at 6:04 PM Christophe Meessen wrote: > I can't change expectations. It is to convert a byte count into a human > readable byte count ( with kB, MB, ... units). So it was an XY problem? No floating point operations are necessary to do that. Also, check several existing

[go-nuts] Re: Inconsistent rounding with float printf ?

2019-12-06 Thread Christophe Meessen
I can't change expectations. It is to convert a byte count into a human readable byte count ( with kB, MB, ... units). I found out that I can produce the expected result by using math.Round. See here https://play.golang.org/p/UorDwbKlLj5 For my use case, I ended up converting "manually" the

Re: [go-nuts] Inconsistent rounding with float printf ?

2019-12-06 Thread Robert Engels
You can use github.com/robaho/fixed > On Dec 6, 2019, at 10:19 AM, Michael Jones wrote: > >  > Agree with Ian. > > Solutions are: change expectations, use decimal floating point, or use a > base-independent decimal representation. The latter implies scaled integers. > > Quick, ugly, and

Re: [go-nuts] Inconsistent rounding with float printf ?

2019-12-06 Thread Michael Jones
Agree with Ian. Solutions are: change expectations, use decimal floating point, or use a base-independent decimal representation. The latter implies scaled integers. Quick, ugly, and typed on one hand from bed, but here it is: https://play.golang.org/p/fBztRY6qHP0 999000/1000 = 999.0

Re: [go-nuts] Help with Go channels and select talk

2019-12-06 Thread Egon Kocjan
There are goroutines in the examples of course, just a single goroutine per bidi channel seems hard. By contrast, I've worked with actor systems before and they are perfectly fine with a single fiber. On Friday, December 6, 2019 at 3:38:20 PM UTC+1, Robert Engels wrote: > > Channels are

Re: [go-nuts] Help with Go channels and select talk

2019-12-06 Thread Robert Engels
Channels are designed to be used with multiple go routines - if you’re not you are doing something wrong. > On Dec 6, 2019, at 8:32 AM, Egon Kocjan wrote: > >  > Hello > > I'm preparing a short talk about Go channels and select. More specifically, I > want to show what not to do. I chose a

[go-nuts] Help with Go channels and select talk

2019-12-06 Thread Egon Kocjan
Hello I'm preparing a short talk about Go channels and select. More specifically, I want to show what not to do. I chose a bidirectional communication channel implementation, because it seems to be a common base for a lot of problems but hard to implement correctly without using any extra

Re: [go-nuts] Inconsistent rounding with float printf ?

2019-12-06 Thread Ian Davis
On Fri, 6 Dec 2019, at 9:25 AM, Christophe Meessen wrote: > I have noticed that printf performs an apparently inconsistent rounding of > floating point values. > > I divide a big number by 1000 and printf the resulting value with "%.1f". > Here is the code: https://play.golang.org/p/e7dD3c6IHq2

[go-nuts] Inconsistent rounding with float printf ?

2019-12-06 Thread Christophe Meessen
I have noticed that printf performs an apparently inconsistent rounding of floating point values. I divide a big number by 1000 and printf the resulting value with "%.1f". Here is the code: https://play.golang.org/p/e7dD3c6IHq2 I would expect the rounding rule to be "round away from zero" as

Re: [go-nuts] Multiple processes in parallel for cgo service

2019-12-06 Thread Nitish Saboo
Hi Ian, The Go code fetches a message from SQS and calls the C code to parse the log messages.So this is what the cgo service does. I would like to run the same service on different processes independently. I am not sure how to achieve this in Go. Can you please guide me here. Thanks, Nitish On