[go-nuts] what does capture by value means here?

2021-02-11 Thread xie cui
https://github.com/golang/go/blob/c31540364c2bc3bdb7800cfc344d85c2c9df3893/src/cmd/compile/internal/gc/main.go#L654 what is captured by value not esacpe means here, can you show a demo code? -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To

Re: [go-nuts] Grouped functions...

2021-02-11 Thread Ian Lance Taylor
On Thu, Feb 11, 2021 at 4:09 PM Trig wrote: > > So, in Go... you can either define imports, constants, types, variables one > at a time... or you can group them using brackets. Why was it decided not to > be able to do that with functions? Just curious. > > func ( > main() { >

[go-nuts] Re: Go based xml manipulation library

2021-02-11 Thread Steve Roth
github.com/beevik/etree does much of what you're looking for. Steve On Thursday, February 11, 2021 at 1:10:51 PM UTC-8 sunto...@gmail.com wrote: > Is there any Go library that allow certain following-sibling > manipulation? > > Specifically, I want

[go-nuts] Grouped functions...

2021-02-11 Thread Trig
So, in Go... you can either define imports, constants, types, variables one at a time... or you can group them using brackets. Why was it decided not to be able to do that with functions? Just curious. func ( main() { fmt.Println(helloWorld()) } helloWorld() string {

[go-nuts] Go based xml manipulation library

2021-02-11 Thread Tong Sun
Is there any Go library that allow certain following-sibling manipulation? Specifically, I want to, - locate an xml node via XPath - delete its following-sibling More or less like this,

[go-nuts] best way and race free case to transfer some value in context to caller

2021-02-11 Thread Vasiliy Tolstov
Hi. i have func like func AAA(ctx context.Context, req interface{}) error {} inside func i need to return some value not via error, but in context (as i only one way do do that) I'm write something like code below. I can't transfer code inside error, because it predefined struct (generated from

Re: [go-nuts] Re: Unable to find small memory leak

2021-02-11 Thread Robert Engels
Are you using CGo or libraries that use CGo? If so, you probably have an off-heap, i.e malloc() leak > On Feb 11, 2021, at 11:11 AM, Tom Mitchell wrote: > >  > >> On Thu, Feb 11, 2021 at 3:40 AM Uli Kunitz wrote: >> You are writing: The device crashes with out of memory. What does crash?

Re: [go-nuts] Re: Unable to find small memory leak

2021-02-11 Thread Tom Mitchell
On Thu, Feb 11, 2021 at 3:40 AM Uli Kunitz wrote: > You are writing: The device crashes with out of memory. What does crash? > The Go program, another program or the kernel? Can you share the error > message? Can you share the log file for one day of GODEBUG=gctrace=1? > > In bash do: > > $

Re: [go-nuts] Recommendation for Fuzzed Types without Native On-Disk Format

2021-02-11 Thread Jesper Louis Andersen
On Mon, Feb 8, 2021 at 10:07 PM Matt Proud wrote: > Suppose I am interested in fuzz testing an API using dvyukov/go-fuzz > , and the primary API under test > accepts relatively complex composite data types itself: func F(*Table) > error, where the types below

[go-nuts] Re: Unable to find small memory leak

2021-02-11 Thread Uli Kunitz
You are writing: The device crashes with out of memory. What does crash? The Go program, another program or the kernel? Can you share the error message? Can you share the log file for one day of GODEBUG=gctrace=1? In bash do: $ export GODEBUG=gctrace=1 $ 2>error.log On Thursday, February 11,

[go-nuts] Re: Unable to find small memory leak

2021-02-11 Thread Miles Hex
To be honest, i'm not totally sure, what is see is that memory keep raising until the device crash for out of memory, but what does it mean if reachable object remain constant, but the " Heap objects" keep raising? Even when i manualy trigger the GC! Also the reachable object is not exported