Re: [go-nuts] mutex in slog/handler.go?

2024-05-24 Thread Eli Lindsey
Git blame may be helpful, and specifically commit 847d40d6998. It looks like code drifted from the comment.-eli On May 24, 2024, at 9:25 AM, Jochen Voss wrote:Hello,In the Go standard library, in the file log/slog/handler.go, I found the following code:func (h *commonHandler) clone

Re: [go-nuts] net/http Http Server - fail with Proxy Protocol header (v1/v2)

2024-04-26 Thread Eli Lindsey
.(documented here https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt). You could handle all three plus plaintext http on the same port if you felt so inclined. -eli > On Apr 26, 2024, at 3:40 AM, 'Brian Candler' via golang-nuts > wrote: > > Really I was

[go-nuts] Re: net/http Http Server - fail with Proxy Protocol header (v1/v2)

2024-04-25 Thread Eli
but wanted to mention that. 🙂 -eli On Monday, April 15, 2024 at 4:43:50 PM UTC-4 Brian Candler wrote: > My point is that a http server that is using the standard library always reply with an "HTTP/1.1 400 Bad Request" when the proxy protocol is part of the tcp package. Th

Re: [go-nuts] net/http: no Client API to close server connection based on Response #21978

2024-04-03 Thread Eli Lindsey
conns and gobbles up a disproportionate share of requests. Tangential question, when the backend servers land in this state does the lb not detect and remove them? -eli > On Apr 3, 2024, at 6:41 AM, Robert Engels wrote: > > That probably wasn’t clear. Why not create a Transport per h

Re: [go-nuts] net/http: no Client API to close server connection based on Response #21978

2024-04-02 Thread Eli Lindsey
benign (though I have not checked :) ). -eli > On Apr 2, 2024, at 3:29 PM, Jim Minter wrote: > > Hello, > > I was wondering if anyone had any ideas about > https://github.com/golang/go/issues/21978 ("net/http: no Client API to close > server connection based on Respo

Re: [go-nuts] Re: rsc.io/script: How to contribute?

2024-03-07 Thread Eli Bendersky
On Thu, Mar 7, 2024 at 5:44 AM twp...@gmail.com wrote: > Thanks, but I'm already heavily invested in testscript with over 10K lines > of scripts and a lot of custom configuration, and commander-cli/commander > clearly lacks functionality I need. > OOC, is there anything wrong with github.com/rog

Re: [go-nuts] http2 client has no cached connections

2023-12-12 Thread Eli Lindsey
/0a98a3784fb059fd4458afe70b7737ee is an example of how to trust the cert from httptest.Server and passes locally for me. -eli > On Dec 12, 2023, at 9:12 AM, Nik Steffen wrote: > > Hi fellow gophers, > > I already asked my Question on r/golang but could not get an answer despite > >25

Re: [go-nuts] Go/Python interop

2023-11-22 Thread Eli Bendersky
ike standard ? > Something else ? > All of it, maybe :-) We're just exploring the issue, throwing ideas around. There are many potential options, each with its own tradeoffs in terms of performance vs. effort. Eli > > > Cheers, > -s > > [1] https://github.com/gola

Re: [go-nuts] Go http/2 ClientConn readLoop use more memory than http/1.1

2023-11-16 Thread Eli Lindsey
g the per-stream or per-conn h2 flow control settings? -eli > On Nov 16, 2023, at 7:13 AM, Divyanshu Rawat > wrote: > > In my golang application I was using a x/net/http package with a custom TLS > Config making http/1.1 connections only. I wanted to introduce the http/2 >

[go-nuts] Question about httptrace synchronization

2023-10-26 Thread Eli Lindsey
some additional synchronization guarantee provided by eg. client.Do() that I’m missing and that makes this safe, or is the fact that it doesn’t trip a race happenstance? -eli -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubs

Re: [go-nuts] Question in Converting float64 to uint64

2023-10-25 Thread Eli Lindsey
ult in MaxUint64 across implementations, but that doesn’t appear true in practice. -eli > On Oct 25, 2023, at 7:25 AM, Xie Yuchen wrote: > > Hi Guys, recently, I've been learning the number types conversion. I learned > about the ieee 754 round to even when golang converts from

Re: [go-nuts] (minor) broken link in the Go 1.21 release notes.

2023-08-16 Thread Eli Bendersky
Thanks for reporting. Sent https://go-review.googlesource.com/c/website/+/520215 with a fix On Wed, Aug 16, 2023 at 1:59 AM Jochen Voss wrote: > Hello, > > Not really important, but there is a somewhat broken link in the Go 1.21 > release notes. The introduction says "See “Go versions” in the

Re: [go-nuts] [testing] best practices for the test (client-server)

2023-08-07 Thread Eli Lindsey
net/http/httptest is a great package, either to use if your server is http-based or to emulate if you’re testing other protocols. I’ve also found io.Pipe to frequently be useful for this kind of testing. I’d recommend reading through how net/http and x/net/http2 structures their tests. -eli

Re: [go-nuts] Is there a pure Go packet capture and analysis tool?

2023-07-26 Thread Eli Lindsey
does have some support for this (see the SOCK_RAW based pcapgo in the source tree), though I’m not sure how complete it is and it may have significantly worse performance than the other collection methods - at the very least it could be a useful starting point for writing your own. -eli > On

Re: [go-nuts] simplistic web based chat solution

2023-07-23 Thread Eli Lindsey
d still be primarily server-side changes; it’s essentially a browser-supported API that gets you a TCP connection, so you could fully mimic the netcat behavior from the example. -eli >> On Jul 22, 2023, at 11:26 PM, Tong Sun wrote: >> >> I know web based chatting service can

Re: [go-nuts] simplistic web based chat solution

2023-07-22 Thread Eli Lindsey
tting service, > which would add as minimum to the solution from ch8/chat as possible. I’m not entirely sure what you’re describing here, but carrying the net.Conn in a cookie sounds odd. Could you say more? -eli > On Jul 22, 2023, at 11:26 PM, Tong Sun wrote: > > I know web

Re: [go-nuts] [net/http] How to capture raw client TLS handshake data?

2023-07-17 Thread Eli Lindsey
changes. To me the oversight is that ClientHelloInfo is missing one field (extensions) which prevents it from being useful for most fingerprinting. -eli > On Jul 16, 2023, at 12:51 PM, phus lu wrote: > > An update on > https://github.com/golang/go/issues/32936#issuecomment-1637032

Re: [go-nuts] ¿ Where is the source code of atomic.AddInt32?

2023-04-23 Thread Eli Lindsey
ot all arm64 revisions support atomic arithmetic, so if unavailable it falls back to a load/add/store loop, retrying the add until it succeeds without conflict. -eli > On Apr 23, 2023, at 3:23 PM, Victor Giordano wrote: > > Hi there! > > Hope you are having a great weekend (This

Re: [go-nuts] Is there a golang download for latest patch release like 1.20.x?

2023-03-30 Thread Eli Lindsey
in a little curl/jq/sha256sum to automate discovering, downloading, and verifying the latest release. -eli > On Mar 30, 2023, at 6:14 AM, silverwind wrote: > > Is there a way to download the latest patch release of golang 1.20 which > currently is at 1.20.2. On the available downl

Re: [go-nuts] Redfining loop variable semantics - what's the plan?

2023-03-25 Thread Eli Bendersky
this GOEXPERIMENT in 1.21 (or now, if using gotip). The most useful thing to do would be to run your tests with this experiment set and see what breaks. Looking towards the future, this is also related to the forward compatibility proposal: https://github.com/golang/go/issues/57001 Eli > >

Re: [go-nuts] About source folder organization - Part II

2023-03-21 Thread Eli Lindsey
There are a number of different options and no right or wrong answer. This was a recent blog that I thought did an excellent job of summarizing some of the more common layouts and trade offs https://appliedgo.com/blog/go-project-layout-eli On Mar 21, 2023, at 10:28 AM, Victor Giordano

Re: [go-nuts] what's the most popular kafka library to use

2023-03-13 Thread Eli Lindsey
e that’s not relevant to you anyways. However it comes with the big caveat/potential pain point of requiring cgo. segmentio/kafka-go is also worth considering. It’s my main goto if avoiding cgo. -eli > On Mar 13, 2023, at 12:48 PM, ami malimovka wrote: > > Currently I'm intere

Re: [go-nuts] [net/http] How to capture raw client TLS handshake data?

2023-03-06 Thread Eli Lindsey
It’s not currently possible. Some of us run with patches exposing the TLS extensions to support this use case. The relevant GitHub issue is https://github.com/golang/go/issues/32936-eli On Mar 6, 2023, at 2:14 PM, Aurora wrote:Is it possible to capture the whole TLS handshake data coming from a

Re: [go-nuts] how to handle push in http2 client?

2023-01-26 Thread Eli Lindsey
The x/net/http2 client doesn’t currently support receiving push promises - https://github.com/golang/net/blob/master/http2/transport.go#L2955 The tracking task is https://github.com/golang/go/issues/18594 -eli > On Jan 26, 2023, at 11:29 AM, cheng dong wrote: > > says we do a se

Re: [go-nuts] Refresher tutorial

2022-12-10 Thread Eli Bendersky
There's a good list of resources recommended at https://go.dev/learn/ Start with https://go.dev/tour/welcome/1 Then check out the official tutorials at https://go.dev/doc/tutorial/ On Sat, Dec 10, 2022 at 9:18 AM Ken wrote: > Hi, when I first learned golang, there was a nice tutorial avaiable.

Re: [go-nuts] There is a passage in book that is difficult to understand, can anyone help explain it?

2022-11-02 Thread Eli Lindsey
doesn’t encourage as much as other languages/APIs).-eliOn Nov 2, 2022, at 7:49 AM, Eli Lindsey wrote:Reentrant locks make any given critical section harder to understand because you must also understand the calling pattern that led there to know which invariants have been upheld and which may have

Re: [go-nuts] There is a passage in book that is difficult to understand, can anyone help explain it?

2022-11-02 Thread Eli Lindsey
/count mismatch); more complex code is not, especially when it encounters future maintainers. -eli > On Nov 2, 2022, at 7:43 AM, Robert Engels wrote: > > I am curious though for an example that shows how a reentrant lock could > violate this? > >> On Nov 2, 2022, at 2:

[go-nuts] Easily viewing cross-compiled asm output?

2022-10-02 Thread Eli Lindsey
way. -eli -- 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 vi

Re: [go-nuts] Writing Json output to a file

2022-09-29 Thread Eli Bendersky
reciated. > See https://gobyexample.com/writing-files In general, for simple usage questions like this one, https://gobyexample.com should be a useful resource Eli > > > > > -- > You received this message because you are subscribed to the Google Groups > "golang-n

Re: [go-nuts] How to run a java file using go script.

2022-08-03 Thread Eli Bendersky
You should be able to use the os/exec package (https://pkg.go.dev/os/exec) to invoke external programs from Go. On Wed, Aug 3, 2022 at 5:45 AM PK wrote: > Hi everyone, > I am new to golang. I was writing a script, with which I want to run a > java program. > Can anyone please let me know how to

Re: [go-nuts] ast.NewPackage errors for built in types

2021-10-16 Thread Eli Bendersky
possible that in your environment (WSL2 or what not) invoking subprocesses and stat-ing the filesystem is particularly costly > > > On Sat, 16 Oct 2021 at 14:38, Eli Bendersky wrote: > >> >> >> On Fri, Oct 15, 2021 at 2:13 PM Steven Hartland >> wrote: >&

Re: [go-nuts] ast.NewPackage errors for built in types

2021-10-16 Thread Eli Bendersky
On Fri, Oct 15, 2021 at 2:13 PM Steven Hartland wrote: > I converted my code to x/tools/go/packages > and while it > did solve the problem it's VERY slow in comparison. > > I have a set of 21 tests operating on a single package which has

Re: [go-nuts] sql.Row doubt

2021-08-05 Thread Eli Bendersky
In what case do you find the need to call Columns() on a Row? Generally if you have access to a Row, you also have access to a Rows, which does have a Columns() method. Eli On Thu, Aug 5, 2021 at 10:34 AM Daniel da Silva wrote: > Hello guys! > > Why doesn't sql.Row impleme

Re: [go-nuts] Go 1.16 and modules

2021-03-29 Thread Eli Bendersky
mp$ go version go version go1.16 linux/amd64 /tmp$ go run sample.go hello Or is your 'sample.go' importing code from outside the standard library? Eli > > > > On Monday, March 29, 2021 at 12:33:57 AM UTC-4 amits...@gmail.com wrote: > >>

Re: [go-nuts] How to search standard libarary?

2021-03-16 Thread Eli Bendersky
I really like devdocs.io for this You type "Go" and TAB, and then it will only autocomplete in the Go stdlib. On Tue, Mar 16, 2021 at 7:09 AM jake...@gmail.com wrote: > > For years now, when I needed to casually lookup a standard library > function I would use the search on the website. Like

Re: [go-nuts] Web Application Development

2020-12-09 Thread Eli Bendersky
nes. Others prefer to use more complete web-app frameworks like Gin or Beego. YMMV based on your exact needs. Eli -- 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 e