Re: [go-nuts] Best way to mark unused parameters/error values reported by linter

2023-03-07 Thread Marcello H
The point I was making is not simply to ignore a linter outcome, but add the reason behind it. It might be a bad comment in your opinion, but that was not the point. Op di 7 mrt 2023 om 18:42 schreef Kurtis Rader : > On Mon, Mar 6, 2023 at 10:38 PM Marcello H wrote: > >> What I do (and is a

Re: [go-nuts] HTTP client - streaming POST body?

2023-03-07 Thread Wojciech Kaczmarek
PS. My choice of http.Request with client.Do was misleading, http.Post can be used as well: func uploadStdin(url string) error { resp, err := http.Post(url, "text/plain", os.Stdin) if err != nil { return err } defer resp.Body.Close() if resp.StatusCode >= 400 {

Re: [go-nuts] HTTP client - streaming POST body?

2023-03-07 Thread 'Christian Stewart' via golang-nuts
No... The previous example streams the file as the post request. The only difference in your example is that you're using stdin. It's not that complicated, files also implement io.reader. On Tue, Mar 7, 2023, 1:41 PM Wojciech Kaczmarek wrote: > Hello, > > I think this code example rather

Re: [go-nuts] HTTP client - streaming POST body?

2023-03-07 Thread Wojciech Kaczmarek
Hello, I think this code example rather streams back the response the server sent from its POST handler and it is not exactly what the OP requested ;) (not to mention that the typical result of a POST is an immediate redirect, possibly without body at all). I believe what Jim needs is

Re: [go-nuts] Detecting / Avoiding network bottleneck when sending concurrent HTTP requests to many hosts.

2023-03-07 Thread nohehf
So I unfortunately answered to this via personal email so here's a quick summary of the exchange here (in case anybody else can help): The thing that is weird is that N is pretty low (even with ~20/30 workers it will start to have trouble working, missing some fingerprints). I'll try to

Re: [go-nuts] Best way to mark unused parameters/error values reported by linter

2023-03-07 Thread Kurtis Rader
On Mon, Mar 6, 2023 at 10:38 PM Marcello H wrote: > What I do (and is a good practice), is adding behind the comment more info. > > //nolint:errcheck // no need to test it, because it was tested before with > stat I appreciate that you're replying to what I hope is just a bad example but

[go-nuts] [security] Go 1.20.2 and Go 1.19.7 are released

2023-03-07 Thread announce
Hello gophers, We have just released Go versions 1.20.2 and 1.19.7, minor point releases. These minor releases include 1 security fixes following the security policy : - crypto/elliptic: incorrect P-256 ScalarMult and ScalarBaseMult results The

[go-nuts] Re: Best way to mark unused parameters/error values reported by linter

2023-03-07 Thread Duncan Harris
What is the reason for including the unused parameter in the function signature? If it was a method and the reason was to comply with an interface signature then you can assert the interface to get unparam to ignore: var _ InterfaceType = (*MyType)(nil) or if not a pointer receiver var _

Re: [go-nuts] HTTP client - streaming POST body?

2023-03-07 Thread Yaw Boakye
I could be misleading you here, but my immediate thought is that whether you can stream the body/payload depends on what form you're receiving the query result in? if it's an io.Reader then it looks like you could use it directly. otherwise i'm not sure what you could do to the HTTP client to