Re: [go-nuts] memory leak, heap size doesn't match process res size

2020-04-04 Thread azhao155
Have you figure the root cause? We experience the same issue On Thursday, February 15, 2018 at 7:21:12 AM UTC-8, Kane Kim wrote: > > I was surprised to see that overhead is so significant, is there any way > to peek into that and see what is taking up space in race detector? I've > tried

[go-nuts] Re: How to install protoc-gen-go (Go protocol buffer compiler plugin) in windows ?

2020-04-04 Thread m . rostami9710
Thank you, the problem was the same and surprisingly it has solved by step 7. I have never seen this on a Linux box before, poor Windows. :) On Thursday, June 25, 2015 at 9:25:47 PM UTC+4:30, Joshua wrote: > > Here is the step by step directions: > >1. Download protoc-win32.zip from >

Re: [go-nuts] Re: Pseudo version showing different in go1.12 and go1.13

2020-04-04 Thread Sean Liao
yes On Sat, Apr 4, 2020, 17:07 Nitish Saboo wrote: > Hi Sean, > > Thank you for your response. > The pseudo version that I am getting in go-1.13 is 'v1.8.3-0' and if you > see there is a "-0" in the pseudo version. > Whereas, > The pseudo version that I am getting in go-1.12 is 'v0.0.0' . > >

Re: [go-nuts] Re: Pseudo version showing different in go1.12 and go1.13

2020-04-04 Thread Nitish Saboo
Hi Sean, Thank you for your response. The pseudo version that I am getting in go-1.13 is 'v1.8.3-0' and if you see there is a "-0" in the pseudo version. Whereas, The pseudo version that I am getting in go-1.12 is 'v0.0.0' . 1)We get such outputs only when the dependency version that is being

Re: [go-nuts] Suggestions for dynamic per object lock

2020-04-04 Thread Robert Engels
The code (and even similar using channels) is highly inefficient. You need to understand the expected collision rate because if it’s low (expected) paying the lock cost on every operation is wasteful. Better to partition the work based on the token (hash N) and avoid the lock operations. You

[go-nuts] Suggestions for dynamic per object lock

2020-04-04 Thread Tamás Gulácsi
Check out https://pkg.go.dev/golang.org/x/sync/singleflight ! -- 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 golang-nuts+unsubscr...@googlegroups.com. To view

[go-nuts] Suggestions for dynamic per object lock

2020-04-04 Thread Groups Discussion
Hi all, while refactoring an old application I found this code: type concurrentChecks struct { mutexsync.Mutex activeChecks map[string]int } // addCheck waits until the processing for an item with the same token is finished func (c *concurrentChecks) addCheck(token string) { for {

Re: [go-nuts] Can someone please explain http.HandlerFunc() ?

2020-04-04 Thread Jesper Louis Andersen
The function `notfound` is a plain function. It has a specific signature, (w http.ResponseWriter, r *http.Request). There is a type, HandlerFunc, with the following specification: type HandlerFunc func(ResponseWriter, *Request) Types in Go are "generative", so the HandlerFunc type is different

Re: [go-nuts] Can someone please explain http.HandlerFunc() ?

2020-04-04 Thread Brian Candler
Sorry, but I believe that explanation is wrong. http.HandlerFunc is a type, not a function: https://golang.org/pkg/net/http/#HandlerFunc And so the code shown by the OP is indeed performing a type conversion, to a compatible type which is decorated with methods. You can do the same with plain

Re: [go-nuts] Timer.Reset() (again...)

2020-04-04 Thread Leszek Kubik
I have nothing to comment about timer.Reset() but your pseudo code made me wonder if there's an interval timer available in the library, and of course it is. In the example you aim to do some work periodically, until another type of work succeeds. That's not a plain meaning of a timeout. In

Re: [go-nuts] Can someone please explain http.HandlerFunc() ?

2020-04-04 Thread Tamás Gulácsi
And most importantly (here) functions can have methods ( as any type), so HandlerFunc implements the Handler interface. -- 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