RE: [go-nuts] does Go memory model guarantee this program always prints 1?

2017-07-14 Thread John Souvestre
Hi Marvin. > Yes, assuming the Go authors agree that atomic operations guarantee > non-concurrency. Can we have someone authoritative weigh in here? The Memory Model says that "synchronization primitives" are in the sync and sync/atomic packages. It also says that a "synchronization mechani

Re: [golang-dev] Re: [go-nuts] net: ReadMsg and reading error queue

2017-07-14 Thread Atela Wu
I don't think this is the same thing. after I send out a too big UDP and receive the ICMP need fragment error, I can use MSG_ERRQUEUE flag to receive the mtu info from the same UDP socket. the icmp package only works when you send out a icmp package. 在 2017年7月15日星期六 UTC+8上午9:40:38,Matt Har

Re: [go-nuts] Re: http.Server.Shutdown() crashing?

2017-07-14 Thread charlievx
Ah - that explains it. Even though the bug's been fixed, the behaviour's been bugging me! Thanks for the explanation :-) On Saturday, July 15, 2017 at 11:33:37 AM UTC+10, Matt Harden wrote: > > The reason it was exiting was because you didn't wait at the end of main() > after http.ListenAndServe

Re: [golang-dev] Re: [go-nuts] net: ReadMsg and reading error queue

2017-07-14 Thread Matt Harden
Take a look at https://godoc.org/golang.org/x/net/icmp#PacketTooBig On Fri, Jul 14, 2017 at 6:01 AM wrote: > I want to process the ICMP error and implement UDP PMTU discovery, so I > have to call recvmsg with MSG_ERRQUEUE > > It has been 4 years, any reasonable solutions for this problem?? > >

Re: [go-nuts] Help with mapping XML to struct

2017-07-14 Thread Matthew Zimmerman
Chidley worked great for me -- https://github.com/gnewton/chidley On Fri, Jul 14, 2017 at 9:37 PM Matt Harden wrote: > The sample document you gave actually doesn't have any attributes at all. > I guess you meant namespaces? > > Are you leaving out the namespace declarations from your sample? Th

Re: [go-nuts] Help with mapping XML to struct

2017-07-14 Thread Matt Harden
The sample document you gave actually doesn't have any attributes at all. I guess you meant namespaces? Are you leaving out the namespace declarations from your sample? They usually look like xmlns:soapenv="http://some_url";. Those are important to parsing with namespaces in Go. If you don't have

Re: [go-nuts] Re: http.Server.Shutdown() crashing?

2017-07-14 Thread Matt Harden
The reason it was exiting was because you didn't wait at the end of main() after http.ListenAndServe exited. ListenAndServe will exit as soon as the listening socket is closed, but there can still be connected sockets open at that time (including the one handling /stop). When main returns, the Go p

Re: [go-nuts] Customized Go template FuncMap example

2017-07-14 Thread Tong Sun
Gotya. Thanks for all the helps! On Fri, Jul 14, 2017 at 9:27 PM, Matt Harden wrote: > But you also then have no choice but to wrap every single method that > (that you want to also have) returns a *Template, so that it returns your > own template type instead. That's why I don't think it's a go

Re: [go-nuts] Customized Go template FuncMap example

2017-07-14 Thread Matt Harden
If the type of the map is map[string]interface{}, it can be used with either type of template. https://play.golang.org/p/-sFMhKOtNN If you create your own template type, then you can also create your own FuncMap type, and in your own Funcs method, pass it on to the underlying template: type FuncM

Re: [go-nuts] variable scope in nested go templates

2017-07-14 Thread dsanghani
This is the right answer and a good explanation. Thanks. On Monday, August 27, 2012 at 5:08:28 AM UTC-7, Jesse McNelis wrote: > > On Mon, Aug 27, 2012 at 9:19 PM, RoboTamer > wrote: > > In Linux the pipe is: | and in go it is . (a dot) > > That's not correct. > dot is the "cursor variable",

Re: [go-nuts] Go install recreates .a files that are already present in the pkg directory

2017-07-14 Thread Martin Spasov
I am getting *build ID mismatch* and here I see that it means that something has changed in the package, but I have not modified it in any way. Below is the whole application : package main import ( "os" "github.com/gotk3/gotk3/gtk" ) f

Re: [go-nuts] Go install recreates .a files that are already present in the pkg directory

2017-07-14 Thread Martin Spasov
I am getting *build ID mismatch* and here I see that it means that something has changed in the package, but I have not modified it in any way. Below is the whole application : package main import ( "os" "github.com/gotk3/gotk3/gtk" ) f

Re: [go-nuts] Customized Go template FuncMap example

2017-07-14 Thread Tong Sun
On Thu, Jul 13, 2017 at 10:10 PM, Matt Harden wrote: > Can you do what you want just by building a number of template.FuncMap > values, and then to use them the user just calls > t.Funcs(module1.FuncMap).Funcs(module2.FuncMap), > adding the function maps they want that way? > Yeah, sure, but f

Re: [go-nuts] Go install recreates .a files that are already present in the pkg directory

2017-07-14 Thread Ian Lance Taylor
On Fri, Jul 14, 2017 at 6:27 AM, wrote: > Hey, > > I formatted my OS and now i am having a problem that was not present before. > I am trying to use gotk3 and when i try to install it i run > > go install -v -tags gtk_3_18 > > It used to only rebuild (correct me if im using a wrong verb here) the

[go-nuts] Go install recreates .a files that are already present in the pkg directory

2017-07-14 Thread suburb4nfilth
Hey, I formatted my OS and now i am having a problem that was not present before. I am trying to use gotk3 and when i try to install it i run go install -v -tags gtk_3_18 It used to only rebuild (correct me if im using a wrong verb here) the main.go file as it was the only one modified, but n

Re: [go-nuts] Does scheduler step in my weighted fair queue implementation?

2017-07-14 Thread Ian Lance Taylor
On Fri, Jul 14, 2017 at 2:54 AM, Chifeng Chou wrote: > The reason why using select instead ok-comma is because I don't one upstream > to block another. Using blocking ok-comma is ok when upstreams are fast. > However, when one is slow, others could starve. I see. Well, the approach you are using

Re: [go-nuts] net: ReadMsg and reading error queue

2017-07-14 Thread amankjan
I want to process the ICMP error and implement UDP PMTU discovery, so I have to call recvmsg with MSG_ERRQUEUE It has been 4 years, any reasonable solutions for this problem?? 在 2013年2月28日星期四 UTC+8下午9:31:54,Robert写道: > > +cc golang-dev > +bcc golang-nuts > > Hello, > > I would like to propos

[go-nuts] Help with mapping XML to struct

2017-07-14 Thread Marcin Jurczuk
Hi, I'm stuck at problem how to map XML into Go struct. Most of examples are for xml where you are not storing information in attributes. My have all a lot of data in attrs Example XML: DEVMEMORYINFO 10.1.1.10 1 Any help how should look struct tha

[go-nuts] Re: GKE & Issue 17066

2017-07-14 Thread thwd
Actually, our error output is slightly different than issue 17066's. 2017/07/14 10:53:31 http2: Transport failed to get client conn for :443: http2: no cached connection was available 2017/07/14 10:53:31 http2: Transport creating client conn 0xc4200016c0 to :443 2017/07/14 10:53:31 http2: Frame

[go-nuts] Re: GKE & Issue 17066

2017-07-14 Thread thwd
Seems to be Mac OS related. It works on Linux, every time over HTTP 1 and 2. On Friday, July 14, 2017 at 11:33:22 AM UTC+2, thwd wrote: > > We tried: > > if len(os.Getenv("DISABLE_HTTP2")) > 0 { > http.DefaultClient.Transport = &http.Transport{ > TLSNextProto: make(map[string]func(stri

Re: [go-nuts] Does scheduler step in my weighted fair queue implementation?

2017-07-14 Thread Chifeng Chou
The reason why using select instead ok-comma is because I don't one upstream to block another. Using blocking ok-comma is ok when upstreams are fast. However, when one is slow, others could starve. On Friday, July 14, 2017 at 12:46:27 PM UTC+8, Ian Lance Taylor wrote: > > On Thu, Jul 13, 2017 at

[go-nuts] Re: GKE & Issue 17066

2017-07-14 Thread thwd
We tried: if len(os.Getenv("DISABLE_HTTP2")) > 0 { http.DefaultClient.Transport = &http.Transport{ TLSNextProto: make(map[string]func(string, *tls.Conn) http.RoundTripper), } } But the effect was the same as with GODEBUG=http2client=0, just an EOF. Will keep trying. If it is re

[go-nuts] Re: Gotk3 applications

2017-07-14 Thread Russel Winder
Answering own question: On Fri, 2017-07-14 at 09:10 +0100, Russel Winder wrote: > It appears that all the Gotk3 examples use the old-fashioned > gtk.Init/gtk.Main application structure. I am trying to create a Go > GTK+3 application with the modern > gtk.Application/gtk.ApplicationWindow > structu

[go-nuts] GKE & Issue 17066

2017-07-14 Thread thwd
We use GKE (Kubernetes on GCE) and have Go HTTP/2 pods running there. In front of them is a service of type "LoadBalancer". As I understand, these are nginx instances. Since this week, the error described in issue 17066 [1] is happening about 90% of the time when we connect a client via HTTP/2

[go-nuts] job opportunities

2017-07-14 Thread Jérôme LAFORGE
Hello, What kind of project? What is the range of salary? Regards. -- 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. F

[go-nuts] Gotk3 applications

2017-07-14 Thread Russel Winder
It appears that all the Gotk3 examples use the old-fashioned gtk.Init/gtk.Main application structure. I am trying to create a Go GTK+3 application with the modern gtk.Application/gtk.ApplicationWindow structure. Everything seems to be there except... gtk.Application.AddWindow requires a *gtk.Windo