[go-nuts] Re: Why is src modified when concatenating slices with dst = append(dst, src[:i])

2016-11-19 Thread pierre . curto
Hello and welcome to Go! It will all make sense after reading this: https://blog.golang.org/go-slices-usage-and-internals I leave you to find the solution once you have read the article :). Hint: It indeed has to do with the backing array of the slice. In step1 you are creating a new slice for d

[go-nuts] Why is src modified when concatenating slices with dst = append(dst, src[:i])

2016-11-19 Thread Bogdan Katyński
Hello Group, I'm very new to GoLang and this is my first post to the group so first of all hello all :) I just came across a strange thing which I'm failing to understand: https://play.golang.org/p/BOCsJqIw63 I don't understand why in Step2, the src slice is changed to [1 2 3 4 1 6 7 8] I su

[go-nuts] Interface vs first-class function

2016-11-19 Thread Henry
Hi, I am wondering from best practice point of view whether it is better to use interface or first-class function, especially considering that Go encourages the use of small interfaces. Here is an example: type SomethingDoer interface{ DoSomething(data Data) } func PerformWork(doer Somethin

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

2016-11-19 Thread jonathan . gaillard
https://github.com/golang/go/issues/17985 -- 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:

[go-nuts] Re: Race-free config hierarchy?

2016-11-19 Thread Dave Cheney
On Sunday, 20 November 2016 05:09:41 UTC+11, Tamás Gulácsi wrote: > > Dear Gophers! > > I'm trying to make gopkg.in/rana/ora.v3 race-free. > > It has a deep hierarchy: Rset->Stmt->Ses->Srv->Env. For some config > (logger, default column types...) rset has its own copy, but maybe that's > nil,

[go-nuts] panic: plugin.Open: plugin was built with a different version of package runtime

2016-11-19 Thread conejo
I'm not sure what I'm doing wrong or if I understood at all the plugin package of 1.8 I have a plugin like the example exampleplugin/main.go (build with "go build -buildmode=plugin") package main // // No C code needed. import "C" import "fmt" var V int func F() { fmt.Printf("Hello, numbe

Re: [go-nuts] Re: [ANN] lint - Run linters as part of go test

2016-11-19 Thread sridhar
I've added support for gometalinter. Please take a look at the example in the godoc[1]. Thanks! Sridhar [1] https://godoc.org/github.com/surullabs/lint/gometalinter On Tuesday, November 15, 2016 at 10:41:40 AM UTC+1, sri...@laddoo.net wrote: > > Thanks for the feedback! > > Using metalinter see

Re: [go-nuts] Package Management Survey Results

2016-11-19 Thread Jaana Burcu Dogan
Thanks for sharing the raw results. On Thu, Nov 3, 2016 at 10:11 AM, Matt Farina wrote: > A couple months ago we had a package management survey. Since the survey > closed the data has been fed into the package management committee. > > Now we are sharing the data, that was not asked to be kept

[go-nuts] Race-free config hierarchy?

2016-11-19 Thread Tamás Gulácsi
Dear Gophers! I'm trying to make gopkg.in/rana/ora.v3 race-free. It has a deep hierarchy: Rset->Stmt->Ses->Srv->Env. For some config (logger, default column types...) rset has its own copy, but maybe that's nil, so it has to go to the default, which may be in any of its ancestors... Just to ma

Re: [go-nuts] Re: http.NewRequest stopped to check SSL certificate validity every time

2016-11-19 Thread James Bardin
On Sat, Nov 19, 2016 at 11:33 AM, Vasily Korytov wrote: > It stays there for days, so I'm not sure. And the client is supposed to be > created and destroyed in a function that terminates, so I'm really > surprised by that. > > The connection can stay there for as long as the server and client wan

[go-nuts] Re: http.NewRequest stopped to check SSL certificate validity every time

2016-11-19 Thread Vasily Korytov
On Saturday, November 19, 2016 at 6:21:49 PM UTC+2, James Bardin wrote: > > > Chances are that you're getting better reuse of the client connections. If > you want to ensure that you reconnect periodically use Request.Close when > you don't want the connection maintained, or call > Transport.C

[go-nuts] Re: http.NewRequest stopped to check SSL certificate validity every time

2016-11-19 Thread James Bardin
Chances are that you're getting better reuse of the client connections. If you want to ensure that you reconnect periodically use Request.Close when you don't want the connection maintained, or call Transport.CloseIdleConnections occasionally between requests to force the connections to close.

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

2016-11-19 Thread Tarmigan
The easiest way is to use struct embedding so that your UnixTime can use the time.Time methods: https://play.golang.org/p/WltVTKxylT On Sat, Nov 19, 2016 at 12:32 AM, Sathish VJ wrote: > That by itself works, but I still haven't figured out how to make a custom > marshal type work automatically i

[go-nuts] url2img - HTTP server with API for capturing screenshots of websites

2016-11-19 Thread gen2brain
https://github.com/gen2brain/url2img Uses QtWebKit for rendering. Binaries that are available for downloads are compiled with https://github.com/annulen/webkit , but it should also work with old community builds of webkit. -- You received this message because you are subscribed to the Google G

[go-nuts] Re: http.NewRequest stopped to check SSL certificate validity every time

2016-11-19 Thread Vasily Korytov
P.S. I would like to line out things that changed since the SSL certificate check was working: 1. Newer Go runtime 2. HTTP/2 connection 3. I used http.Get(url) before and now I use http.Client.Do (I use this for customizing the User-Agent header) All the other things did not change, so the chan

[go-nuts] http.NewRequest stopped to check SSL certificate validity every time

2016-11-19 Thread Vasily Korytov
Hi, I've got code like: client := &http.Client{} req, _ := http.NewRequest("GET", "https://localhost";, nil) resp, err := client.Do(req) I believe that prior to Golang 1.6 or something like this this bailed out with err when the SSL certificate is not valid (expired or other things). That is:

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

2016-11-19 Thread Sathish VJ
That by itself works, but I still haven't figured out how to make a custom marshal type work automatically in both directions. i.e. the streaming part in json is in unix time format but internally it is time.Time. Can we put a custom type in the tag value? Something like this? T time.Time `jso