[go-nuts] Positional arguments and flag package

2020-10-08 Thread Amit Saha
Hi all, I realize that the flag package stops parsing os.Args[] once it finds a non "-" character. This means, if I invoke my program as: $ ./myprog arg1 -d value flag.Parse() will stop parsing the moment it sees arg1 and result in NArg() returning 2 instead of 1. Is there a recommended worka

Re: [go-nuts] Re: Will there be something like "net/quic" in the future?

2020-10-08 Thread ran...@gmail.com
On Friday, October 9, 2020 at 1:16:58 AM UTC+8 axel.wa... wrote: > OP wrote "as you may have already heard, the standardization for QUIC is > almost done", implying this was a question about a future, stable spec for > QUIC. > Exactly. I was wondering whether or not Go will ship a QUIC package

Re: [go-nuts] Building the embedded static assets prototype

2020-10-08 Thread Ian Lance Taylor
On Thu, Oct 8, 2020 at 3:46 PM David Moles wrote: > > I'm trying to build the prototype code for the embedded static assets > proposal, but I'm not having any luck. I'm new to building Go from source, > and new to gerrit and to the Go contribution & development process, so > apologies in advanc

[go-nuts] Building the embedded static assets prototype

2020-10-08 Thread David Moles
I'm trying to build the prototype code for the embedded static assets proposal , but I'm not having any luck. I'm new to building Go from source, and new to gerrit and to the

[go-nuts] Re: Capture Outgoing Port for a HTTP Request

2020-10-08 Thread ryan...@gmail.com
That was exactly what I was looking for. Thank you! On Thursday, October 8, 2020 at 1:12:39 PM UTC-5 urji...@gmail.com wrote: > Hi Ryan, > > You can get it via httptrace (https://blog.golang.org/http-tracing) > > Example: > req, _ := http.NewRequest("GET", "http://example.com";, nil) > trace

[go-nuts] Re: Capture Outgoing Port for a HTTP Request

2020-10-08 Thread urji...@gmail.com
Hi Ryan, You can get it via httptrace (https://blog.golang.org/http-tracing) Example: req, _ := http.NewRequest("GET", "http://example.com";, nil) trace := &httptrace.ClientTrace{ GotConn: func(connInfo httptrace.GotConnInfo) { fmt.Printf("Got Conn:

Re: [go-nuts] Re: in "_ = debug && mylog.Infof("%s %d", str, n)", will the mylog.Infof call be always not executed if variable debug is false?

2020-10-08 Thread Jan Mercl
On Thu, Oct 8, 2020, 17:40 tapi...@gmail.com wrote: > It looks the answer should be yes, as Go spec says: > >Logical operators apply to boolean > values and yield a result of > the same type as the operands. The right operand is evaluated > conditio

Re: [go-nuts] Re: Will there be something like "net/quic" in the future?

2020-10-08 Thread 'Axel Wagner' via golang-nuts
On Thu, Oct 8, 2020 at 7:09 PM Amnon wrote: > But quic-go can be used with net/http > > Just call http3.ListenAndServeQUIC instead of http.ListenAndServeTLS > and all your handlers should just work. > That would mean you are *not* using `net/http`. In particular, it means code would need to expl

Re: [go-nuts] Re: Will there be something like "net/quic" in the future?

2020-10-08 Thread Amnon
But quic-go can be used with net/http Just call http3.ListenAndServeQUIC instead of http.ListenAndServeTLS and all your handlers should just work. QUIC is still evolving, and putting it inside the Go standard library means that it would be bound by the Go 1 compatibility promise, effectively fr

[go-nuts] Re: Reduced error handling noice

2020-10-08 Thread Johan Martinsson
Indeed I learned this from https://blog.golang.org/defer-panic-and-recover and they mention this is done in the json module. And I couldn't adhere more. It's basically the same as try-catch from other languages. Doing this systematically in a Rest server for errors of type 502, 400, 404 (in t

Re: [go-nuts] Re: Will there be something like "net/quic" in the future?

2020-10-08 Thread 'Axel Wagner' via golang-nuts
I think part of that has been answered: It allows using it with net/http. On Thu, Oct 8, 2020 at 6:37 PM Amnon wrote: > You can try https://github.com/lucas-clemente/quic-go > > You asked specifically about a builtin package i.e. a package in the > standard library. > But I am not sure what adva

[go-nuts] Re: Will there be something like "net/quic" in the future?

2020-10-08 Thread Amnon
Also worth watching the talk by the author https://www.youtube.com/watch?v=BvpRBdWwecU&ab_channel=dotconferences On Thursday, 8 October 2020 at 17:36:12 UTC+1 Amnon wrote: > You can try https://github.com/lucas-clemente/quic-go > > You asked specifically about a builtin package i.e. a package in

[go-nuts] Re: Will there be something like "net/quic" in the future?

2020-10-08 Thread Amnon
You can try https://github.com/lucas-clemente/quic-go You asked specifically about a builtin package i.e. a package in the standard library. But I am not sure what advantages locating new protocols into the standard library would bring. On Thursday, 8 October 2020 at 09:00:20 UTC+1 ran...@gmai

Re: [go-nuts] ECDSA signature verification

2020-10-08 Thread Shobhit Srivastava
Thank you Marcin for your response. It is really helpful. On Thu, 8 Oct 2020, 21:52 Marcin Romaszewicz, wrote: > Yes, in my experience, the C SSL libraries are much faster than Go's > implementation on curves P384 and P521, however, Go's tuned implementation > of P256 curves is comparable to Op

Re: [go-nuts] ECDSA signature verification

2020-10-08 Thread Marcin Romaszewicz
Yes, in my experience, the C SSL libraries are much faster than Go's implementation on curves P384 and P521, however, Go's tuned implementation of P256 curves is comparable to OpenSSL performance ( https://golang.org/src/crypto/elliptic/). If you look in the directory I linked, you'll see that it h

Re: [go-nuts] ECDSA signature verification

2020-10-08 Thread Shobhit Srivastava
Thanks for the detailed explanation for your issue. Thanks for the pointers for the library. Just a quick question, do you think calling C library from Go can give great results for 521 curve. On Thu, 8 Oct 2020, 21:03 Marcin Romaszewicz, wrote: > My issue was slightly different than yours, in

[go-nuts] Re: in "_ = debug && mylog.Infof("%s %d", str, n)", will the mylog.Infof call be always not executed if variable debug is false?

2020-10-08 Thread tapi...@gmail.com
It looks the answer should be yes, as Go spec says: Logical operators apply to boolean values and yield a result of the same type as the operands. The right operand is evaluated conditionally. Is my understanding right? On Thursday, October 8,

Re: [go-nuts] ECDSA signature verification

2020-10-08 Thread Marcin Romaszewicz
My issue was slightly different than yours, in that I was burning way too much CPU verifying 384 bit client certificates for TLS. The solution was to have nginx do TLS termination, and proxy decrypted traffic to my Go server, rather than doing TLS termination in Go. The first place I would start l

[go-nuts] in "_ = debug && mylog.Infof("%s %d", str, n)", will the mylog.Infof call be always not executed if variable debug is false?

2020-10-08 Thread tapi...@gmail.com
. -- 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. To view this discussion on the web visit https://groups.google.com/d

Re: [go-nuts] ECDSA signature verification

2020-10-08 Thread Shobhit Srivastava
Hey Marcin Can you give me the pointer on C library and if can be used in Cgo . Thanks On Wed, 7 Oct 2020, 22:27 Shobhit Srivastava, wrote: > Yeah the inclination is towards 512 curve only so need to optimise it. > > Will check out the C library. Thanks > > > > On Wed, 7 Oct 2020, 22:22 Marcin

Re: [go-nuts] Proposal to add Index operator methods

2020-10-08 Thread Raanan Hadar
So the first paragraph in my answer to Jon addresses this. But I think I could have been clearer: I think 80% of the readability problem is addressed by index operator methods, which is the critical part. Full operator overloading is nice to have in my opinion and I argue people will gladly liv

[go-nuts] Will there be something like "net/quic" in the future?

2020-10-08 Thread ran...@gmail.com
Hello people :D I just want to pop up to ask whether or not there will be a builtin package that implements QUIC for Go. As you may have already heard, the standardization for QUIC is almost done, many people are rushing to implement the protocol for their own product. Since more and more peop