[go-nuts] database/sql works when run it, but with test it complains about unknown driver

2020-10-14 Thread farid sobhany
I am using database/sql to connect to a Mssql server and it works when I run the application. But when I setup a test file and tried to call the function that makes the connection and store it in an instance, it complains about "Unknown driver \"mssql\" (forgotten import?)" I am not importing th

Re: [go-nuts] Positional arguments and flag package

2020-10-14 Thread Roland Müller
I guess it's usage of flag is meant in to behave like parsing flags in Unix/LInux, or Python' argparse: - after the command you have the flags denoted by '-' - after flags follow rest of command line args where elements can be every character string BR, Roland Am Fr., 9. Okt. 2020 um 07

Re: [go-nuts] Positional arguments and flag package

2020-10-14 Thread Roland Müller
Actually, it's explicitly documented, so I don't have to guess: https://golang.org/pkg/flag/#hdr-Command_line_flag_syntax Am Do., 15. Okt. 2020 um 08:22 Uhr schrieb Roland Müller : > I guess it's usage of flag is meant in to behave like parsing flags in > Unix/LInux, or Python' argparse: > >

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

2020-10-14 Thread ryan...@gmail.com
My timeout is configurable, but I usually set it to 5 or 10 seconds. Plenty of time for a TLS handshake. Based on the code you gave me, increasing the timeout to 5 seconds, and changing the target endpoint to match the behavior I'm seeing, this is the output. Get Conn: <>:<> Conn start: tcp <>

[go-nuts] Go 1.15.3 and Go 1.14.10 are released

2020-10-14 Thread Alex Rakoczy
Hello gophers, We have just released Go versions 1.15.3 and 1.14.10, minor point releases. View the release notes for more information: https://golang.org/doc/devel/release.html#go1.15.minor You can download binary and source distributions from the Go web site: https://golang.org/dl/ To

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

2020-10-14 Thread Urjit Singh Bhatia
It depends on how far down the connection process it reached before timing out... What is the timeout setting your http client? Try this example: func main() { req, _ := http.NewRequest("GET", "https://deelay.me/300/https://google.com";, nil) trace := &httptrace.ClientTrace{ GetConn: func(host

[go-nuts] Re: CSS-like selectors for Go AST?

2020-10-14 Thread cpu...@gmail.com
Hi Max, Great answer, thank you! Exactly what I was looking for in terms of a fluid api, no need for parsing the selectors. The API is not quite suitable for public consumption. I feel this could be a great success if extracted into its own module. Could you kindly clarify what the meaning of t

[go-nuts] Re: CSS-like selectors for Go AST?

2020-10-14 Thread Max
I can only agree, traversing or navigating Go AST is cumbersome for at least two reasons: 1. each type has its own fields - no uniform API is available 2. you often need type assertions on fields because they have interface type instead of concrete type I developed a wrapper around them to mitig