[go-nuts] unmarshal unix time from a json stream is of different format

2016-11-18 Thread Dave Cheney
UnixTime and time.Time are different types with different method sets. UnixTime is not a subclass or a child type of time.Time as there is no such thing as inheritance in go. Try printing this value. time.Time(*t) Dave -- You received this message because you are subscribed to the

[go-nuts] Avoiding function call overhead in packages with go+asm implementations

2016-11-18 Thread Damian Gryski
This is one of those tricks that should be in a "best practices for writing asm with Go" document. Maybe we should start one on the wiki? Including things like "common build tags for disabling asm" and the like. Damian -- You received this message because you are subscribed to the Google

[go-nuts] Where to start to learn about Go compiler and others low level part?

2016-11-18 Thread nvcnvn
All I ever do is some simple web applications or kind of microservice for CMS stuff. Now I want to process to something deeper as a programmer. Everytime reading Go core team discussion about compiler, GC... I know that serious deep and complicate stuff. Now I have plenty of time and want to

[go-nuts] Re: http2 client/server reversal performance

2016-11-18 Thread jonathan . gaillard
Actually it turns out that the tests from the http2 client writing into a request and the http2 server reading from the request is slow. That is despite whether the http2 server is on the server end of the tcp connection or the client end. This is between two machines with a 55ms latency. Scp

Re: [go-nuts] macro support in text/template

2016-11-18 Thread mhhcbon
Solved that issue by creating components on server side, they hold a reference to the template, their block name, their configuration, so they can expose a render method to consume within the view. https://github.com/mh-cbon/mdl-go-components On Friday, November 18, 2016 at 10:23:21 PM

Re: [go-nuts] macro support in text/template

2016-11-18 Thread Manlio Perillo
Il giorno venerdì 18 novembre 2016 21:23:38 UTC+1, Ian Lance Taylor ha scritto: > > On Fri, Nov 18, 2016 at 11:50 AM, Manlio Perillo > wrote: > > > > I'm trying to implement HTML form support in Go, > > Forms are one of the most complex components to implement in a web

Re: [go-nuts] macro support in text/template

2016-11-18 Thread Ian Lance Taylor
On Fri, Nov 18, 2016 at 11:50 AM, Manlio Perillo wrote: > > I'm trying to implement HTML form support in Go, > Forms are one of the most complex components to implement in a web > application. > > Here is a simple form with only two text field, using bootstrap: >

[go-nuts] macro support in text/template

2016-11-18 Thread Manlio Perillo
Hi. I'm trying to implement HTML form support in Go, Forms are one of the most complex components to implement in a web application. Here is a simple form with only two text field, using bootstrap: https://gist.github.com/anonymous/5a21a22e6d5fd9d0f745c1700c634b54 Writing the HTML code by hand

[go-nuts] http2 client/server reversal performance

2016-11-18 Thread jonathan . gaillard
Forgot to note that if I flip the coffee around to the "normal" case where the serveconn is done by the server the speed is as expected over WAN. Are there some internal settings different for the client vs server? -- You received this message because you are subscribed to the Google Groups

Re: [go-nuts] Short Variable Declaration Question

2016-11-18 Thread Ian Davis
I think the sentence is supposed to read something like this: "The second declares out (and assigns to it as before) but only assigns a value to the existing err variable (without declaring it)" On Fri, Nov 18, 2016, at 03:02 PM, Terry McKenna wrote: > Hi Guys, > > I am reading "The Go

[go-nuts] Re: Best practice when creating temporary files

2016-11-18 Thread Val
Obtain a new temp file : tmpfile, err := ioutil.TempFile("", "") Obtain a new temp dir : dir, err := ioutil.TempDir("", "") I suggest you don't bother with cleanup. It should work on any OS. On Friday, November 18, 2016 at 11:21:23 AM UTC+1, Ondrej wrote: > > I have a tool that generates

[go-nuts] Short Variable Declaration Question

2016-11-18 Thread Terry McKenna
Hi Guys, I am reading "The Go Programming Language": Donovan, Kernighan (pg.31): "One subtle but important point: a short variable declaration does not necessarily declare all the variables on the its left-hand side. If some of them were already declared in the same lexical block then then the

[go-nuts] Re: [ANN] (GUI) Qt binding which supports Windows / macOS / Linux / Android / iOS / Sailfish OS / Raspberry Pi

2016-11-18 Thread therecipe
It's intended to be build against Qt 5.7. And I think Qt 5.6.2 works also (with some errors/warnings during the setup) I may add backward compatibility in the future, but it's not planned yet. I use this script to get Qt 5.7 on trusty, if you want to link against system libs.

[go-nuts] Re: Help! Can't get cgo to work

2016-11-18 Thread hhzguo
I ran into the same problem. in one of my go file, I have: //#cgo CFLAGS: -I/usr/include/libnl3 /* #include However, when I try to build, I got the following error: ( I have libnl-3-dev, libnl-genl-3-dev installed and the netlink/netlink.h file is at /usr/include/libnl3/ directory.

Re: [go-nuts] where is my lib? cgo and c libraries

2016-11-18 Thread hhzguo
"Go means to make life easier, however, it goes other direction. On Saturday, April 6, 2013 at 10:43:01 AM UTC-7, Peter Kleiweg wrote: > > Op zaterdag 6 april 2013 15:52:05 UTC+2 schreef Ian Lance Taylor het > volgende: > > Now that we use external linking, this is going to be pushed into the

Re: [go-nuts] Re: http.Client stops working after connected to VPN

2016-11-18 Thread Diep Pham
Tamás Gulácsi wrote: > In this casee you should just retry: the VPN transition may mean that > the previously resolved DNS address of google.com has changed, or the > whole routing has changed, and you have to start over. Well, the program do many sequential HTTP calls. I guess I will have to

Re: [go-nuts] Avoiding function call overhead in packages with go+asm implementations

2016-11-18 Thread Aram Hăvărneanu
On Fri, Nov 18, 2016 at 4:41 AM, Caleb Spare wrote: > Aram gave me the idea of using //go:linkname as a hacky workaround; > this doesn't work within a single package What do you mean exactly? It works here, in fact, I use this. -- Aram Hăvărneanu -- You received this

[go-nuts] Re: http.Client stops working after connected to VPN

2016-11-18 Thread Tamás Gulácsi
2016. november 18., péntek 12:25:15 UTC+1 időpontban Diep Pham a következőt írta: > > Tamás Gulácsi wrote: > > Either allow accessing google.com through the VPN, or configure the > > network to only "use the resources" on the VPN, do not forward all > > traffic through it. > > Maybe I

Re: [go-nuts] Best practice when creating temporary files

2016-11-18 Thread Tamás Gulácsi
2016. november 18., péntek 12:21:48 UTC+1 időpontban Jan Mercl a következőt írta: > > On Fri, Nov 18, 2016 at 11:21 AM Ondrej > wrote: > > Not sure if it's correct, just an idea (error handling elided): > > func main() { > ... >

[go-nuts] Re: http.Client stops working after connected to VPN

2016-11-18 Thread Diep Pham
Tamás Gulácsi wrote: > Either allow accessing google.com through the VPN, or configure the > network to only "use the resources" on the VPN, do not forward all > traffic through it. Maybe I didn't describe the problem clearly. VPN configuration is OK, I can connect to Google normally. Only the

Re: [go-nuts] Best practice when creating temporary files

2016-11-18 Thread Jan Mercl
On Fri, Nov 18, 2016 at 11:21 AM Ondrej wrote: Not sure if it's correct, just an idea (error handling elided): func main() { ... exec.Cmd(browser, pathName).Start() syscal.Unlink(pathName) } The temp file

[go-nuts] Re: http.Client stops working after connected to VPN

2016-11-18 Thread Tamás Gulácsi
2016. november 17., csütörtök 15:52:54 UTC+1 időpontban Diep Pham a következőt írta: > > I have a program that periodically does a HTTP GET. The simplified codes > looks like that. > > ``` > package main > > import ( > "log" > "net/http" > "testing" >

[go-nuts] Re: Best practice when creating temporary files

2016-11-18 Thread Tamás Gulácsi
2016. november 18., péntek 11:21:23 UTC+1 időpontban Ondrej a következőt írta: > > I have a tool that generates some HTML and launches a web browser to > display it. For this to work, I need to save the HTML some place and I also > need to handle the file afterwards. The app itself doesn't

[go-nuts] Best practice when creating temporary files

2016-11-18 Thread Ondrej
I have a tool that generates some HTML and launches a web browser to display it. For this to work, I need to save the HTML some place and I also need to handle the file afterwards. The app itself doesn't persist - it generates the content and exits. There are thus two issues I'm struggling

[go-nuts] Re: httputil.ReverseProxy adding 100+ ms of latency on localhost - any ideas?

2016-11-18 Thread Tom
The plot thickens. My attempt to make a minimally-reproducible short example has failed - my demo (here ) does not reproduce the problem, even though it's mostly copy paste. That leaves the code in my original project to blame. The server-being proxied is