Hi Konstantin
Thanks for the reply - this is exactly what I needed! It even seems
like tls.Conn has a function NetConn that allows me to get my net.Conn
back again. So for anyone stumbling on this in the future, I think
this is the way to solve it:
* Make the customer TLS dialer dial a TCP connec
I have created an http.Client with a custom TLS dialer. The custom TLS
dialer creates a *tls.Conn and while doing this, it logs out a lot of
information such as which server is used.
Now, when I make an HTTP request, I want to log out which dial produced the
*tls.Conn the HTTP request ended up
I want to hear if anybody has an idea on how I can find a very small memory
leak in a Go program? The program is a service running for days and weeks.
I am not even 100% sure there is a memory leak, but when I look at the
memory usage graphs based on data from runtime.ReadMemStats it looks l
://github.com/golang/go/issues/44026
Thanks,
Christian
On Mon, Feb 1, 2021 at 11:54 AM roger peppe wrote:
>
> On Sat, 30 Jan 2021 at 20:12, Christian Worm Mortensen
> wrote:
>
>> Hi Mike,
>>
>> Thank you for your consideration. I think you exactly got the essence of
&g
I ended up creating an issue on this:
https://github.com/golang/go/issues/44026
On Sat, Jan 30, 2021 at 9:12 PM Christian Worm Mortensen
wrote:
> Hi Mike,
>
> Thank you for your consideration. I think you exactly got the essence of
> my question: How do I wait on all go routines t
rg/src/net/http/cookiejar/jar.go#L159
>> So while technically Jar.Cookies is never tested the
>> risk is basically nil.
>>
>> V.
>> On Thursday, 28 January 2021 at 22:15:50 UTC+1 Christian Worm Mortensen
>> wrote:
>>
>>> Hi!
>>>
>
ote:
> Try something like
> github.com/facebookgo/clock
>
>
> On Thursday, 28 January 2021 at 21:15:50 UTC Christian Worm Mortensen
> wrote:
>
>> Hi!
>>
>> Suppose I want to unit test this function:
>>
>> func generator() <-chan in
Hi!
Suppose I want to unit test this function:
func generator() <-chan int {
ret := make(chan int)
go func() {
for i := 0; i < 10; i++ {
ret <- i
time.Sleep(time.Second)
}
}()
return ret
}
What is a good way to do that? One way is to do it is like this:
func testGenerator() {
start := time.Now(