Re: [go-nuts] Initialize Variables in case clause of a switch

2016-08-09 Thread Dan Kortschak
On Fri, 2016-08-05 at 08:57 -0700, dc0d wrote: > In Go we can write: > > if _, ok := input.(*data); ok { > //... > } > > Why is it we can't do that in the case clause of a switch statement: > > switch { > case x1,ok:=input.(*data1); ok && otherCond1: > case x2,ok:=input.(*data2); ok && otherCond

[go-nuts] Re: Initialize Variables in case clause of a switch

2016-08-09 Thread Nate Finch
I actually just tried to do this the other day. Forgot it wasn't possible. Seems like it would make the language more consistent to allow it. As it is, it's rather surprising that it doesn't work. -- You received this message because you are subscribed to the Google Groups "golang-nuts" gr

[go-nuts] crypto/x509 doesn't recognzie legacy certificate signature algorithm

2016-08-09 Thread carlgreen
Hi, I am trying to write a Go client to connect to an HTTPS server. I am having trouble with the certificates provided from this server, with an error "x509: cannot verify signature: algorithm unimplemented". I think I've tracked this down to a legacy OID in the certificate for the signature a

Re: [go-nuts] Segmentaion fault / static binary

2016-08-09 Thread willat8
I am having the exact same problem with the same build environment. If I rename /lib/x86_64-linux-gnu/libcrypto.so.1.0.0 to something different then the binary runs no problems. So libcrypto is being statically linked. But why would a statically linked binary care about the system copy of libcryp

Re: [go-nuts] Crosscompiling LXD for ppc64 (big endian) #16640

2016-08-09 Thread Ian Lance Taylor
On Tue, Aug 9, 2016 at 12:32 PM, Guillermo Cordon wrote: > > 1.) What version of Go are you using (go version)? > > > go version go1.6.3 linux/amd64 > > > 2.)What operating system and processor architecture are you using (go env)? > > > Ubuntu 14.04 with the following kernel: > > Linux ubuntu 3.13

[go-nuts] Crosscompiling LXD for ppc64 (big endian) #16640

2016-08-09 Thread Guillermo Cordon
1.) What version of Go are you using (go version)? go version go1.6.3 linux/amd64 2.)What operating system and processor architecture are you using (go env)? Ubuntu 14.04 with the following kernel: Linux ubuntu 3.13.0-91-generic #138 -Ubuntu SMP Fr

Re: [go-nuts] Why is reflect.ValueOf(nil map).Interface() != nil?

2016-08-09 Thread Ian Lance Taylor
On Tue, Aug 9, 2016 at 9:48 AM, Sam Salisbury wrote: > > The update I suggest is to add the following sentence to the end of the > reflect.Value.IsNil documentation: > >> Likewise, if v was created by calling ValueOf on an initialised >> interface{} value with a nil value pointer j, v.IsNil will r

Re: [go-nuts] Why is reflect.ValueOf(nil map).Interface() != nil?

2016-08-09 Thread Sam Salisbury
Playground link for above code: https://play.golang.org/p/rTrkkzEjRl On Tuesday, 9 August 2016 17:48:22 UTC+1, Sam Salisbury wrote: > > Thanks for the explanation, > > The update I suggest is to add the following sentence to the end of the > reflect.Value.IsNil documentation: > > Likewise, if v w

Re: [go-nuts] Why is reflect.ValueOf(nil map).Interface() != nil?

2016-08-09 Thread Sam Salisbury
Thanks for the explanation, The update I suggest is to add the following sentence to the end of the reflect.Value.IsNil documentation: Likewise, if v was created by calling ValueOf on an initialised interface{} > value with a nil value pointer j, v.IsNil will return true, whereas j == > nil wi

[go-nuts] Re: TCP RST and TLS

2016-08-09 Thread MartinG
> With plain TCP, a client write followed by a server read and finally a > client read results in the client getting a "connection reset" error. This > is expected and reflects the RST seen in a TCP packet as can be seen using > tcpdump. > Correction: I meant to say "a client write followed

[go-nuts] TCP RST and TLS

2016-08-09 Thread MartinG
Hi, I noticed a difference in how errors can be returned between a plain TCP connection and a TLS connection. With plain TCP, a client write followed by a server read and finally a client read results in the client getting a "connection reset" error. This is expected and reflects the RST seen

Re: [go-nuts] Re: go process memory limits and gurantees

2016-08-09 Thread gaurav
Please find reply inline: On Tuesday, August 9, 2016 at 8:10:46 PM UTC+5:30, Michael Jones wrote: > > First, a related question—if an attempt to allocate is about to fail, or > succeeds while crossing a threshold of “low memory remaining” (if this is > even knowable), does/should the runtime ch

Re: [go-nuts] Why is reflect.ValueOf(nil map).Interface() != nil?

2016-08-09 Thread Michael Jones
The interface is like an envelope. You “open it” to see what’s inside. Sending nothing (no envelope arrives) is not the same as sending an empty envelope (i.e., interface is non-nil, pointer within is nil). It never confused me, beyond my general confusion from thinking in similes and metaphor

Re: [go-nuts] Re: go process memory limits and gurantees

2016-08-09 Thread Michael Jones
First, a related question—if an attempt to allocate is about to fail, or succeeds while crossing a threshold of “low memory remaining” (if this is even knowable), does/should the runtime change the GC policy to be very aggressive and exploit all possible avenues to remedy? A low water / high wat

[go-nuts] Re: go process memory limits and gurantees

2016-08-09 Thread gaurav
Thank you for the confirmation! Wonder if I am approaching the problem in a wrong way? How is memory sizing usually done for Go applications - if one is not willing to allocate 2X of the process (real) memory needs? On Tuesday, August 9, 2016 at 8:15:37 AM UTC+5:30, bronze man wrote: > > I do n

Re: [go-nuts] Why is reflect.ValueOf(nil map).Interface() != nil?

2016-08-09 Thread Ian Lance Taylor
On Tue, Aug 9, 2016 at 6:23 AM, Sam Salisbury wrote: > > All this gets me thinking, is there any use case where this fact is useful? > (I.e. a nil-valued interface not being equal to nil via the == operator.) This has been discussed several times on the mailing list. An interface value == nil if

Re: [go-nuts] Why is reflect.ValueOf(nil map).Interface() != nil?

2016-08-09 Thread Sam Salisbury
Thanks! All this gets me thinking, is there any use case where this fact is useful? (I.e. a nil-valued interface not being equal to nil via the == operator.) Also, should the reflect.Value.IsNil documentation be updated? It doesn't mention this cas

Re: [go-nuts] net/http and static binaries

2016-08-09 Thread Amit Saha
On Tue, Aug 9, 2016 at 1:38 AM, Seb Binet wrote: > > > On Mon, Aug 8, 2016 at 5:12 PM, Ian Lance Taylor wrote: >> >> On Sun, Aug 7, 2016 at 7:08 PM, Amit Saha wrote: >> > >> > From an old thread [1], I learned that CGO_ENABLED=0 will create static >> > binaries for programs using the net/http pa

[go-nuts] How to debug golang compiler on ubuntu14.04 or win7

2016-08-09 Thread qibo
Hi,all I want to debug Golang compiler on win7 or ubuntu14.04, Dose anyone has good method? Thank you -- 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-nut

Re: [go-nuts] Reject Unknown clients

2016-08-09 Thread Vasiliy Tolstov
2016-08-09 12:26 GMT+03:00 Naveen Shivegowda : > HI Sam, > > For feature parity purpose we wanted(if possible in golang) to handle this > in code itself instead of using other methods. > We are checking if any way is there in Go to reject connections at http > server level it self or else we will s

[go-nuts] Re: Looking for part-time or full time golang programmers

2016-08-09 Thread Joe Blue
I am interested. Have been doing golang for maybe 2 years and used to work for pharmaceuticals and medical industry, which might help. I am in Germany, not shanghai. joe AT gmail DOT com cheers Joe On Monday, May 27, 2013 at 10:55:28 AM UTC+2, Vikrant Rathore wrote: > > Dear All, > > I am lo

Re: [go-nuts] Why is reflect.ValueOf(nil map).Interface() != nil?

2016-08-09 Thread Jakob Borg
2016-08-09 10:26 GMT+02:00 Sam Salisbury : > So, for purely academic reasons, what if I wanted to write a function to > look inside an interface value to determine if its value pointer is nil? > > I tried this, following from your simplified example Steven > https://play.golang.org/p/oG2aQzlKfc

Re: [go-nuts] Reject Unknown clients

2016-08-09 Thread Naveen Shivegowda
HI Sam, For feature parity purpose we wanted(if possible in golang) to handle this in code itself instead of using other methods. We are checking if any way is there in Go to reject connections at http server level it self or else we will start using iptables. Regards Naveen S On Thu, Aug 4, 201

Re: [go-nuts] Re: godoc question

2016-08-09 Thread Kiki Sugiaman
Got it. -- 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. For more options, visit https://groups.google.com/d/optout.

Re: [go-nuts] Re: godoc question

2016-08-09 Thread Dave Cheney
This is not a Go 1.7 regression, so not a blocker on the 1.7 final release next week. On Tuesday, 9 August 2016 18:45:02 UTC+10, ksug wrote: > > Thanks Dave. Could you clarify what you mean by "This is not a 1.7 > blocker"? > -- You received this message because you are subscribed to the Goog

Re: [go-nuts] Re: godoc question

2016-08-09 Thread Kiki Sugiaman
Thanks Dave. Could you clarify what you mean by "This is not a 1.7 blocker"? -- 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.

Re: [go-nuts] Why is reflect.ValueOf(nil map).Interface() != nil?

2016-08-09 Thread Sam Salisbury
Ah, thanks, surprised I've never hit this issue before. So, for purely academic reasons, what if I wanted to write a function to look inside an interface value to determine if its value pointer is nil? I tried this, following from your simplified example Steven https://play.golang.org/p/oG2