[go-nuts] Is there a way to limit number or requests on a KeepAlive connection on net/http server?

2020-01-12 Thread Tamás Gulácsi
Use Server.ConnState to count idle connections, and close them as you wish. -- 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

Re: [go-nuts] Ignoring errors from os.File.Close

2020-01-12 Thread Ian Lance Taylor
On Sun, Jan 12, 2020 at 9:19 PM Philip Boampong wrote: > > On Mon, Jan 13, 2020 at 3:07 AM Ian Lance Taylor wrote: >> >> The difference between os.Stdout and other files is: if writing to >> os.Stdout fails, where are you going to report the error? You could >> report it to os.Stderr, of

Re: [go-nuts] Golang on ARMv5

2020-01-12 Thread Ian Lance Taylor
On Sun, Jan 12, 2020 at 6:50 PM Anthony Adams wrote: > > Thanks again. That’s very helpful. It sounds like ARMv5 is still supported. > Now I just need to confirm the minimum kernel version. The system I’m using > has a 2.6.39.4 kernel, which I’m unable to upgrade. This document says the >

[go-nuts] Is there a way to limit number or requests on a KeepAlive connection on net/http server?

2020-01-12 Thread zohaib . hassan
Hey folks, I've been digging around for a while but could not find anything; is there something with builtin HTTP server that I can do to limit the maximum number of requests allowed with KeepAlive connection? I found fast http provides an option *MaxRequestsPerConn* to do so,

Re: [go-nuts] Ignoring errors from os.File.Close

2020-01-12 Thread Philip Boampong
On Mon, Jan 13, 2020 at 3:07 AM Ian Lance Taylor wrote: > The difference between os.Stdout and other files is: if writing to > os.Stdout fails, where are you going to report the error? You could > report it to os.Stderr, of course, but if os.Stdout doesn't work then > it is very likely that

[go-nuts] float behaviour on arm64 v amd64

2020-01-12 Thread Dan Kortschak
I am going through failures that I see in Gonum tests when we build on arm64 (Travis now provide this). In many cases there are slight differences that I'm OK with adding a tolerance to accept, but in one case (stat.ROC[0][1]) I see an error that can be completely avoided by changing the

Re: [go-nuts] Golang on ARMv5

2020-01-12 Thread Anthony Adams
Thanks again. That’s very helpful. It sounds like ARMv5 is still supported. Now I just need to confirm the minimum kernel version. The system I’m using has a 2.6.39.4 kernel, which I’m unable to upgrade. This document says the minimum kernel version for ARM is v3.1, but I assume this is for the

[go-nuts] Re: go.dev is live!

2020-01-12 Thread marwan . sameer
Hi there, Is there an issue to track when/if the code for pkg.go.dev will be open sourced? Happy to open an issue as I couldn't find one. Thank you! On Wednesday, November 13, 2019 at 12:16:46 PM UTC-5, Julie Qiu wrote: > > Hey Gophers, > > We are excited to share that go.dev, a new hub

Re: [go-nuts] Ignoring errors from os.File.Close

2020-01-12 Thread Ian Lance Taylor
On Sun, Jan 12, 2020 at 4:39 PM wrote: > > Up until now I've been in the habit of checking Close errors on files written > to, but I never closed os.Stdout after use (for the purpose of error > reporting), and now I'm thinking that's inconsistent. > > In this commit message [1], Ian Lance

Re: [go-nuts] Golang on ARMv5

2020-01-12 Thread Ian Lance Taylor
On Sun, Jan 12, 2020 at 1:32 PM wrote: > > Thanks for the reply, Ian. I’ve seen the page you referenced, but the 1.8 > release notes say that it will be the last version to support ARMv5. I’ve > also come across some posts that mention certain minimum Linux kernel > requirements, but nothing

[go-nuts] Ignoring errors from os.File.Close

2020-01-12 Thread pboampong5
Hello, Up until now I've been in the habit of checking Close errors on files written to, but I never closed os.Stdout after use (for the purpose of error reporting), and now I'm thinking that's inconsistent. In this commit message [1], Ian Lance Taylor wrote: "Programs should always check the

Re: [go-nuts] Golang on ARMv5

2020-01-12 Thread anthony . adams . 561
Thanks for the reply, Ian. I’ve seen the page you referenced, but the 1.8 release notes say that it will be the last version to support ARMv5. I’ve also come across some posts that mention certain minimum Linux kernel requirements, but nothing that lists them by Golang version. -- You

Re: [go-nuts] Golang on ARMv5

2020-01-12 Thread Dan Kortschak
Yes, I use Go on ARMv5. AFAIK it still works. On Sun, 2020-01-12 at 12:51 -0800, Ian Lance Taylor wrote: > On Sun, Jan 12, 2020 at 10:17 AM wrote: > > > > Does anyone know where I can find a list of Go versions that > > includes the architectures supported and minimum kernel version > >

Re: [go-nuts] Golang on ARMv5

2020-01-12 Thread Ian Lance Taylor
On Sun, Jan 12, 2020 at 10:17 AM wrote: > > Does anyone know where I can find a list of Go versions that includes the > architectures supported and minimum kernel version requirements. I’d like to > use Go on an ARM926EJ processor (ARMv5tejl), running a 2.6.39.4 Linux kernel. > It looks like

Re: [go-nuts] Somone knows about a good monkey patching library

2020-01-12 Thread Ori Newman
Hi, The attached gist can't work for patching methods. And I do not want to use dependency injection. This is a very big project and I'm beyond the point that I can change it to use dependency injection. On Sunday, January 12, 2020 at 10:00:31 PM UTC+2, prakash sharma wrote: > > > I would

Re: [go-nuts] Somone knows about a good monkey patching library

2020-01-12 Thread prakash sharma
I would suggest to use *function as type* and replace it at the run time For more info visit these link: https://gist.github.com/husobee/9ff87a6f27e9abb4a3bc // now a patch example > oldDoSomething := doSomething > // reset func after completing method > *defer func () { doSomething =

[go-nuts] [ANN] SFTPGo 0.9.5 Released

2020-01-12 Thread Nicola Murino
I'm pleased to announce SFTPGo 0.9.5. SFTPGo is a free and open source full featured and highly configurable SFTP server. It works on Linux, macOS and Windows. Here are the main new features compared to 0.9.4 version: - Support for Git repositories over SSH. - Support for rsync over SSH. -

[go-nuts] Error in google.golang.org/api/option

2020-01-12 Thread max2020new
In my docker file , I have following Lines RUN go get -v -u go.mongodb.org/mongo-driver/mongo RUN go get -d -v ./... ***RUN go get google.golang.org/api/option* I am getting following error . Everything was working fine 3 days before. Step 9/17 : RUN go get

[go-nuts] Somone knows about a good monkey patching library

2020-01-12 Thread Ori Newman
Hi, I know https://github.com/bouk/monkey , but it has a very restrictive license (it says "I do not give anyone permissions to use this tool for any purpose. Don't use it."). Someone knows an alternative with a better license? Thanks in advance -- You received this message because you are

[go-nuts] Golang on ARMv5

2020-01-12 Thread anthony . adams . 561
Does anyone know where I can find a list of Go versions that includes the architectures supported and minimum kernel version requirements. I’d like to use Go on an ARM926EJ processor (ARMv5tejl), running a 2.6.39.4 Linux kernel. It looks like they stopped supporting ARMv5 awhile ago (v1.8?), so

Re: [go-nuts] Mocked method not working in golang while running the test cases

2020-01-12 Thread prakash sharma
Thanks for your help Chris Introduced *dependency injection* in this code using Delegation Design pattern with the help of interface. Here's the details explanation https://stackoverflow.com/a/59704965/5133838 Please share yours feedback. On Sat, 11 Jan, 2020, 9:39 PM Chris Burkert, wrote: >

Re: [go-nuts] Language spec question: why is k, v := k, v allowed in a for loop with range?

2020-01-12 Thread Silvan Jegen
Jan Mercl <0xj...@gmail.com> wrote: > On Sun, Jan 12, 2020 at 10:10 AM Silvan Jegen wrote: > > > So the declaration of the variables in the for loop itself is in outer > > scope compared to the body of the for loop? > > The outer scope begins immediately after the keyword "for". The inner > one

[go-nuts] Senior Go Engineer Position At Coder

2020-01-12 Thread nhooyr
I’m a senior engineer at coder.com. We’re a small startup in Austin looking to hire a senior Go engineer. The role would involve developing and maintaining the Go microservices that power our development platform on kubernetes. We want someone by our downtown Austin office but are open to

Re: [go-nuts] Language spec question: why is k, v := k, v allowed in a for loop with range?

2020-01-12 Thread Jan Mercl
On Sun, Jan 12, 2020 at 10:10 AM Silvan Jegen wrote: > So the declaration of the variables in the for loop itself is in outer > scope compared to the body of the for loop? The outer scope begins immediately after the keyword "for". The inner one is an ordinary block scope and it begins

Re: [go-nuts] Language spec question: why is k, v := k, v allowed in a for loop with range?

2020-01-12 Thread Dan Kortschak
On Sun, 2020-01-12 at 10:10 +0100, Silvan Jegen wrote: > So the declaration of the variables in the for loop itself is in > outer scope compared to the body of the for loop? Yes. > In that case, redeclaring them in the inner scope (== the loop body) > would not be allowed either, no? What? The

Re: [go-nuts] Language spec question: why is k, v := k, v allowed in a for loop with range?

2020-01-12 Thread Silvan Jegen
Dan Kortschak wrote: > The gopher operator is allowed to be used because the body of the for > loop is a new scope. In the second example, the a, b := b, a is not in > a new scope. So the declaration of the variables in the for loop itself is in outer scope compared to the body of the for loop?

Re: [go-nuts] Language spec question: why is k, v := k, v allowed in a for loop with range?

2020-01-12 Thread Dan Kortschak
The gopher operator is allowed to be used because the body of the for loop is a new scope. In the second example, the a, b := b, a is not in a new scope. On Sun, 2020-01-12 at 09:09 +0100, Silvan Jegen wrote: > Hi fellow gophers > > The following code compiles > > > package main > > import (

Re: [go-nuts] Language spec question: why is k, v := k, v allowed in a for loop with range?

2020-01-12 Thread Ian Davis
The range clause introduces a new scope. See this version of your second example: https://play.golang.org/p/UXI_w6B4DW5 -- Ian On Sun, 12 Jan 2020, at 8:09 AM, Silvan Jegen wrote: > Hi fellow gophers > > The following code compiles > > > package main > > import ( > "fmt" > ) > > func

[go-nuts] Language spec question: why is k, v := k, v allowed in a for loop with range?

2020-01-12 Thread Silvan Jegen
Hi fellow gophers The following code compiles package main import ( "fmt" ) func main() { mymap := map[string]int{"a": 1, "b": 2} for k, v := range mymap { k, v := k, v fmt.Printf("k %s, v: %d\n", k, v) } } while this one