[go-nuts] Re: memory leak with websocket service based on go-socket.io

2016-09-05 Thread aiden0xz
The number of goroutines is normal., but the memory continue increase. I did not understand why the runtime.goexit took so many memory. 在 2016年9月6日星期二 UTC+8上午11:07:42,Dave Cheney写道: > > It looks like your application is using 4.5gb of ram. Check the number of > sockets and goroutines you have

Re: [go-nuts] compile vs stylistic errors

2016-09-05 Thread Sam Whited
On Mon, Sep 5, 2016 at 6:22 PM, Anmol Sethi wrote: > What seperates a compile and stylistic error? As in, why not make the > non-gofmt style illegal and enforce the gofmt style by the compiler? Two reasons, I think: 1. It would make the compiler more complicated 2.

[go-nuts] Re: Help me, i don't understand why

2016-09-05 Thread Van Hu
Hope this helps: https://play.golang.org/p/5UnIuSE50F package main import "time" func main() { // redact ch1 := make(chan struct{}) ch2 := make(chan struct{}) go func() { for _, value := range []int{1, 3, 5} { // redact println(value) // redact <-ch1 ch2<-struct{}{} } }() go func() { for _,

[go-nuts] Re: [golang-dev] help me with gorutines

2016-09-05 Thread Dave Cheney
Please redirect this question to golang-nuts. On Sun, Sep 4, 2016 at 7:22 AM, Ринат Галиев wrote: > Hi, i need to solve the task: > Change the program so that the numbers 1 through 6 were printed to the > console in order. Allowed to amend the sections of code that are

[go-nuts] Parsing of an RSA Public Key raises an error: Help Needed

2016-09-05 Thread Sadick Junior
Parsing of the public key raises an error. I have not been able to know why. I have looked at the jwt docs, the public key is valid. someone please help. It seems am missing something. Any help will be highly appreciated. Here is a link to my github gist

[go-nuts] Re: gorutine, channels

2016-09-05 Thread Ринат Галиев
I'm sorry, I do not know why the code is translated))) This is original: https://play.golang.org/p/vWkfa2l0lC -- 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: gorutine, channels

2016-09-05 Thread Ринат Галиев
I'm sorry, I do not know how it happened this is original code: https://play.golang.org/p/tUMlHWHfJE Allowed to amend the sections of code that are marked commentary «// redact» пятница, 2 сентября 2016 г., 21:25:44 UTC+3 пользователь dja...@gmail.com написал: > > working examle: >

[go-nuts] Re: Reflection: Set the Pointer to Zero Value of Direct Type

2016-09-05 Thread dc0d
You're awesome! And Go's reflection is much better than what I've expected - and yes, I like it, I use it! On Tuesday, September 6, 2016 at 12:57:45 AM UTC+4:30, Roberto Zanotto wrote: > > If you want a pointer instead of the direct value, just use New instead of > Zero: > v =

[go-nuts] Re: Reflection: Set the Pointer to Zero Value of Direct Type

2016-09-05 Thread dc0d
Exactly! Thanks! Now, how to put it inside the pointer? I mean, how to get it's address and put that address inside the pointer variable? On Monday, September 5, 2016 at 10:47:23 PM UTC+4:30, Roberto Zanotto wrote: > > I should learn to read the questions more carefully before answering -_- > In

[go-nuts] Re: Reflection: Set the Pointer to Zero Value of Direct Type

2016-09-05 Thread Roberto Zanotto
I should learn to read the questions more carefully before answering -_- In the code you commented out, fd.Type() is a pointer type, so the zero value of a pointer type is a nil pointer. If you do fd.Type().Elem() it gives you the "dereferenced" type of the value. So, maybe you want: v =

[go-nuts] Re: Reflection: Set the Pointer to Zero Value of Direct Type

2016-09-05 Thread Roberto Zanotto
I suppose you want to allocate a new value, since fd is nil: fd = reflect.New(reflect.TypeOf(fd).Elem()) On Monday, September 5, 2016 at 7:28:13 PM UTC+2, dc0d wrote: > > How can I fill a pointer to point to the zero value of underlying type? > > Like in: > > if fd.Kind() == reflect.Ptr { > if

[go-nuts] Reflection: Set the Pointer to Zero Value of Direct Type

2016-09-05 Thread dc0d
How can I fill a pointer to point to the zero value of underlying type? Like in: if fd.Kind() == reflect.Ptr { if fd.IsNil() { // how to set v (pointer) to point to a zero value of underlying type? // using this: // v = reflect.Zero(fd.Type()).Interface() // still gives a nil value. } else

Re: [go-nuts] Re: Introducing Planet Golang

2016-09-05 Thread Mateusz Czapliński
On Sunday, September 4, 2016 at 2:44:53 PM UTC+2, Nicolas Martyanoff wrote: > Speaking about Google, does someone know who to contact to get permission > to > add the feed of the official Go blog (blog.golang.org) ? > I suppose it'd be best to ask Andrew Gerrand. -- You received this

[go-nuts] Re: job queue with the ability to kill worker processes

2016-09-05 Thread Jason E. Aten
On Thursday, September 1, 2016 at 4:40:50 AM UTC-7, Tieson Molly wrote: > > Are there any go projects that implement a queue where workers that > consume the queue could be tracked and potentially killed if the end user > decides to cancel the job? > I assume you mean across multiple worker

[go-nuts] Re: Speeding up Go Report Card

2016-09-05 Thread James Aguilar
On Friday, September 2, 2016 at 6:50:58 AM UTC-7, Shawn Smith wrote: > > Hi, > > I'm one of the maintainers of Go Report Card http://goreportcard.com/ and > I am looking for advice on how to make it faster. > > Basically we run a series of checks (gofmt, vet, etc.) on your Go > repository and

Re: [go-nuts] Re: In case you missed it: language benchmarks for Go 1.7, and language adoption

2016-09-05 Thread Jason E. Aten
On Wednesday, August 31, 2016 at 8:44:57 AM UTC-7, Eric Johnson wrote: > > > On 8/31/16 2:04 AM, Harald Weidner wrote: > > The Java counterpart of this benchmark does not use the Java build-in > > maps, but imports a map implementation for fixed data types from the > > fastutil project. > >

Re: [go-nuts] Speeding up Go Report Card

2016-09-05 Thread Nick Craig-Wood
On 02/09/16 14:41, Shawn Smith wrote: > I'm one of the maintainers of Go Report Card http://goreportcard.com/ > and I am looking for advice on how to make it faster. > > Basically we run a series of checks (gofmt, vet, etc.) on your Go > repository and provide a grade based on how many errors