Re: [go-nuts] how to handle push in http2 client?

2023-01-26 Thread Eli Lindsey
The x/net/http2 client doesn’t currently support receiving push promises - https://github.com/golang/net/blob/master/http2/transport.go#L2955 The tracking task is https://github.com/golang/go/issues/18594 -eli > On Jan 26, 2023, at 11:29 AM, cheng dong wrote: > > says we do a server-push from

[go-nuts] Re: golang protobuf, struct copy problem

2023-01-26 Thread cheng dong
gob have bad performance compare to gogo-proto. in fact, every reflection base encode/decode library do bad On Thursday, May 21, 2020 at 12:03:18 AM UTC+8 Saied Seghatoleslami wrote: Why not use gob encoding? I am using it across nats and it is working fine. The only workaround that I have ha

[go-nuts] how to handle push in http2 client?

2023-01-26 Thread cheng dong
says we do a server-push from http2 server, then how could we handle it in golang code by http client in go 1.20rc3? was there a HandlePush in early go version, if i did not forget -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe

Re: [go-nuts] Variable Declaration inside infinite loop

2023-01-26 Thread Ian Lance Taylor
On Thu, Jan 26, 2023, 8:15 AM Roland Müller wrote: > > > Am Mittwoch, 25. Januar 2023 schrieb 'Jakob Borg' via golang-nuts < > golang-nuts@googlegroups.com>: > > On 25 Jan 2023, at 12:26, Shashwat wrote: > >> > >> Is it safe to declare a variable inside an infinite loop ? > >> > >> for { > >>

Re: [go-nuts] %v display of nil map

2023-01-26 Thread Andrew Athan
I should have RTFMed, but even there, the nil display issue is not highlighted :) Thanks. It seemed odd that there wasn't already a way. It might be good to highlight this feature in the right places. I'm not sure if golangdocs.com is the official easy on-ramp for golang but if so, at https://gola

Re: [go-nuts] Variable Declaration inside infinite loop

2023-01-26 Thread Robert Engels
Java would no-op that entire loop since it does nothing that is externally visible. > On Jan 26, 2023, at 9:30 AM, Roland Müller wrote: > >  > > Am Mittwoch, 25. Januar 2023 schrieb 'Jakob Borg' via golang-nuts > : > > On 25 Jan 2023, at 12:26, Shashwat wrote: > >> > >> Is it safe to decla

[go-nuts] Re: Endless Running Goroutine Terminates Without Panic

2023-01-26 Thread Brian Candler
On Thursday, 26 January 2023 at 15:38:28 UTC Brian Candler wrote: > As a goroutine may terminate if panic occurs If that happens, it will crash the entire program (go isn't python :-) https://go.dev/play/p/YD3lQ-xWe29 ... although other goroutines may continue for a very short time afterwards.

[go-nuts] Re: Endless Running Goroutine Terminates Without Panic

2023-01-26 Thread Brian Candler
> As a goroutine may terminate if panic occurs If that happens, it will crash the entire program (go isn't python :-) https://go.dev/play/p/YD3lQ-xWe29 > I used recover() to log the error and the monitoring thread is re-created. But this doesn't help either. I noticed that the goroutine has bee

Re: [go-nuts] Variable Declaration inside infinite loop

2023-01-26 Thread Roland Müller
Am Mittwoch, 25. Januar 2023 schrieb 'Jakob Borg' via golang-nuts < golang-nuts@googlegroups.com>: > On 25 Jan 2023, at 12:26, Shashwat wrote: >> >> Is it safe to declare a variable inside an infinite loop ? >> >> for { >> a := 0 >> a += 1 >> } >> >> Won't this cause memory allocation in e

[go-nuts] Endless Running Goroutine Terminates Without Panic

2023-01-26 Thread Shashwat
I need to monitor the status of the N sensors and log it. I am creating a separate goroutine for each sensor which fetches the state and logs it at regular intervals. For each goroutine, a channel is created to read the termination signal. Each sensor's state is maintained in sync.Map. The map