Re: [go-nuts] Would this race condition be considered a bug?

2018-03-18 Thread anmol via golang-nuts
I was not intentionally doing it. Some packages, for example mock in https://github.com/stretchr/testify use %#v to print debug information and this was causing a race condition in one of my failing tests because it was printing the context with %#v while some other code in my program was cance

[go-nuts] Re: Would this race condition be considered a bug?

2018-03-18 Thread anmol via golang-nuts
I'm considering only the case when there is a concurrent print of the context and also a concurrent context cancel. On Friday, March 16, 2018 at 5:16:27 AM UTC-4, Jérôme Champion wrote: > > Any race is a bug. When there is a race, the compiler is free to do > whatever it wants. > > What do you w

[go-nuts] Re: [ANN] gluo v0.0.2 released - Write your Go net/http server once, deploy it everywhere

2018-01-27 Thread anmol via golang-nuts
What do you think about offering a second variant to allow passing in the http server? It's possible one may want to set limits or other configuration on the HTTP server instead of using the default http server. On Thursday, January 25, 2018 at 6:42:03 PM UTC-5, Dario Castañé wrote: > > I'm plea

[go-nuts] Re: [ANN] reverse proxy with ssl in less than 100 lines of code

2017-12-29 Thread anmol via golang-nuts
Here is a better way to redirect from HTTPS to HTTP: https://github.com/nhooyr/redirecthttp/blob/d87881e4fbfddb1614c9d0934ea97c4163903301/main.go#L10-L19 Also, you don't need a secure variable in the handler, just check for r.TLS. On Thursday, December 28, 2017 at 12:10:16 PM UTC-5, jzs wrote:

[go-nuts] Re: Is net.Conn concurrency-safe?

2017-12-18 Thread anmol via golang-nuts
Ah I see. You mean its obvious that multiple goroutines may invoke methods on a Conn simultaneously, your question is whether its safe or not, which the docs do not answer. The docs definitely intend on meaning that it is in fact safe to invoke methods on a Conn simultaneously. But I agree, th

[go-nuts] Re: Is net.Conn concurrency-safe?

2017-12-18 Thread anmol via golang-nuts
Not sure where what is prompting your question, how are the docs misleading? The docs are very clear, net.Conn is concurrency safe. On Monday, December 18, 2017 at 7:51:26 AM UTC-5, SP wrote: > > In the documentation for https://golang.org/pkg/net/#Conn, it's stated > that > > Multiple goroutin

[go-nuts] Re: Why are can't struct field types not be used as types

2017-12-11 Thread anmol via golang-nuts
OP said he does not want to litter his code with helper types. On Sunday, December 10, 2017 at 1:30:33 PM UTC-5, Kevin Malachowski wrote: > > Why not name the inner type? https://play.golang.org/p/8hyMLUVbCp -- You received this message because you are subscribed to the Google Groups "golang-nu

[go-nuts] Re: net/http 404 error handling

2017-11-30 Thread anmol via golang-nuts
Not disagreeing or agreeing but just want to mention that Brad's suggested solution is not ideal because the a http.ResponseWriter may implement more interfaces than just http.ResponseWriter. When you wrap a response writer with an intercepting response writer, you cannot cast the intercepting r

Re: [go-nuts] Reading os.Stdin, Unbuffered

2017-11-28 Thread anmol via golang-nuts
Use https://godoc.org/golang.org/x/crypto/ssh/terminal#MakeRaw to set raw mode on the stdin terminal. Then you can just read from os.Stdin into a single byte buffer. If the read completes, then a key was pressed. On Tuesday, November 28, 2017 at 12:12:44 AM UTC-5, dc0d wrote: > > For example I

Re: [go-nuts] os/exec stdout bytes.Buffer and timeout behavior?

2017-10-20 Thread anmol via golang-nuts
There is an open issue regarding this behaviour. https://github.com/golang/go/issues/21922 -- 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..

[go-nuts] does the syscall package allow zero bytes in the filename?

2017-01-07 Thread anmol via golang-nuts
Was the suggestion from this commit https://github.com/golang/go/commit/706832a0882c7300889238d5f4d476dc2ee83ad0 ever implemented? -- 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

[go-nuts] Re: dialing a name with multiple addresses

2016-09-27 Thread anmol via golang-nuts
I understand now. If the first IP fails, it uses the next one and so on until it runs out of IPs or the timeout occurs. On Tuesday, September 27, 2016 at 5:23:18 PM UTC-4, Anmol Sethi wrote: > > For https://godoc.org/net#Dialer , it says "When dialing a name with > multiple IP addresses, the tim