Re: [go-nuts] Deleting map entry from the top level of a nested map doesn't clean the underlying memory

2020-05-07 Thread Urjit Singh Bhatia
Hi Naveen, Your expectations about the program immediately giving up memory on deleting an object are wrong. If there is a need for you to have very tight memory controls, you could look into turning GC off entirely and managing memory yourself - See

Re: [go-nuts] Deleting map entry from the top level of a nested map doesn't clean the underlying memory

2020-05-07 Thread Ian Lance Taylor
On Thu, May 7, 2020 at 11:57 AM Naveen Kak wrote: > > Ian, > Any thoughts on this? Appreciate a response. I'm sorry, I'm not sure what you want a response on. Using top is a fine way to see total memory usage of your application. It's a terrible way to examine the Go garbage collector. Using

Re: [go-nuts] Deleting map entry from the top level of a nested map doesn't clean the underlying memory

2020-05-07 Thread Naveen Kak
Ian, Any thoughts on this? Appreciate a response. Thanks Naveen On Tue, 5 May, 2020, 8:34 PM Naveen Kak, wrote: > Hi Ian, > I explored a few things, calling debug.FreeOSMemory periodically. This > does help, I see a definitely a change in the memory being returned to the > OS ( looking at top

Re: [go-nuts] Type Assertion on File type

2020-05-07 Thread Marvin Renich
* André kouamé [200507 12:57]: > I want to check, if the value return by my function has the type *os.File > This my code : > func createFile(filename string) (*os.File, error) { > f, err := os.OpenFile(filename, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644) > return f, err > > } > //Test code >

[go-nuts] Re: DisableKeepAlive not being honored in http.transport

2020-05-07 Thread Ryan Rank
When I change to a different URI (https://foo.com/bar) it works as expected. So there's something with the original response that causes this to not work. I'm curious as to what, but this is working as designed and expected. Thank you for the help! -- You received this message because you

Re: [go-nuts] Type Assertion on File type

2020-05-07 Thread Andy Balholm
The problem is that the function’s return type is already *os.File (rather than io.WriteCloser or some other interface), so the type assertion is pointless. Andy > On May 7, 2020, at 5:09 AM, André kouamé wrote: > > Hi, > > I want to check, if the value return by my function has the type

[go-nuts] Re: DisableKeepAlive not being honored in http.transport

2020-05-07 Thread Ryan Rank
Interesting. No headers coming back. -- 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

[go-nuts] Re: DisableKeepAlive not being honored in http.transport

2020-05-07 Thread Ryan Rank
.98 is the client, .36 is the server. This is the end of one transaction and the beginning of another. The client sends a FIN-ACK, then immediately starts the next transaction with the SYN packet. After that, the connection is ended; it looks like the client sends the RST packet. I'll take

[go-nuts] Type Assertion on File type

2020-05-07 Thread André kouamé
Hi, I want to check, if the value return by my function has the type *os.File This my code : func createFile(filename string) (*os.File, error) { f, err := os.OpenFile(filename, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644) return f, err } //Test code filename := "testfile" f, _ :=

Re: [go-nuts] terminating goruntime internal threads

2020-05-07 Thread Pavan
correction just to clarify in my previous mail : please read it as "around 34 go internal pthreads" instead of "around 34 goroutines" Ian, the go internal pthreads left out after termination of all the goroutines have the data (few strings allocated in application) as it is. I am trying to

[go-nuts] Re: [ANN] Unicode text segmentation

2020-05-07 Thread Matt Sherman
Sorry, bad link. Here it is: https://github.com/clipperhouse/uax29 On Thursday, May 7, 2020 at 12:06:18 PM UTC-4, Matt Sherman wrote: > > Hi gophers, I’ve implemented Unicode text segmentation for Go: > https://github.com/clipperhouse/uax29/words > > It tokenizes text into words, sentences or

[go-nuts] Re: flags package: shared flags and flag sets

2020-05-07 Thread Manlio Perillo
On Wednesday, May 6, 2020 at 2:08:25 PM UTC+2, Chris Burkert wrote: > > Dear all, > > I'd like to mix shared flags with flags specific to flag sets (cooltool > ). However I struggle to parse the > shared flags only and pass the rest to the flagset for parsing. Here is > what I came up with: >

[go-nuts] [ANN] Unicode text segmentation

2020-05-07 Thread Matt Sherman
Hi gophers, I’ve implemented Unicode text segmentation for Go: https://github.com/clipperhouse/uax29/words It tokenizes text into words, sentences or graphemes according to the Unicode spec . I’d been tokenizing text in ad hoc ways, and then learned that

[go-nuts] Re: DisableKeepAlive not being honored in http.transport

2020-05-07 Thread Amnon Baron Cohen
In these situations I would normally use wireshark to look at the life-cycle of a single session. Which direction are the FIN and RST packets going? Are they sent from the client, or the server? If the RST packets are sent by the server - i.e. the server is slamming shut the connection, then the

[go-nuts] Re: DisableKeepAlive not being honored in http.transport

2020-05-07 Thread Ryan Rank
This is what I did, and see no change in behavior. for i := 0; i < 10; i++ { response, err :=client.Get("https://foo.com;) if err!= nil{ panic(err) } ioutil.ReadAll(response.Body) response.Body.Close() } The network trace shows a SYN, SYN-ACK, ACK at the beginning of

Re: [go-nuts] Re: flags package: shared flags and flag sets

2020-05-07 Thread Chris Burkert
Thank you very much. This is exactly what I was looking for. A simple way without the need for additional packages. Highly appreciated! Am Do., 7. Mai 2020 um 07:28 Uhr schrieb mural : > https://play.golang.org/p/Sga78gMLn-9 > > You can then use it like './mycli -d stream -rt' > > The '-d'