[go-nuts] Re: Best Practices for Error Handling in Go APIs

2025-02-04 Thread Darren Grant
What's the current best practice for getting a stack trace from an error passed up from further down in the stack? E.g. a web server middleware uses recover to catch panics. In the recover, we want the stack trace of the code that created the first error in the stack. On Monday, 3 February 202

Re: [go-nuts] debug/gosym.PCToLine breaks on cgo enabled binaries

2024-03-14 Thread 'Grant Seltzer Richman' via golang-nuts
On Wednesday, March 13, 2024 at 4:37:31 PM UTC-4 Ian Lance Taylor wrote: On Wed, Mar 13, 2024 at 8:04 AM 'Grant Seltzer Richman' via golang-nuts wrote: > > I've been using the `Table.PCToLine` method to resolve program counters (extracted via bpf) into functions with

[go-nuts] debug/gosym.PCToLine breaks on cgo enabled binaries

2024-03-13 Thread 'Grant Seltzer Richman' via golang-nuts
. Another issue I have with this API is that creating the Table requires passing the `.gosymtab` which of course is empty. Cgo binaries don't even have it so I just pass an empty slice. Does anyone have alternatives to this package or possible explanations to why these issues exist? Thanks

[go-nuts] Re: Go-native abstract service interface design

2023-11-16 Thread Grant Zvolský
Upon reflection, I would make the following improvements to bring the interfaces closer to Go's philosophical ideals: * Remove the App interface because it only has one implementation * Remove the Named interface because all its usages seem to be replaceable with a package-scoped const * Split t

[go-nuts] Re: Go-native abstract service interface design

2023-11-15 Thread grant
edit: The `App` interface has just one implementation which adds the ~4 builtin "Runnables". It is used to implement 5-10 different services each of which adds its custom "Runnables". On Wednesday, November 15, 2023 at 7:06:08 AM UTC-5 grant wrote: > I've stumbled u

[go-nuts] Go-native abstract service interface design

2023-11-15 Thread grant
I've stumbled upon a set of interfaces that doesn't feel quite right, but I can't say why exactly. ``` type ( Named interface { Name() string } App interface { Named Run() error Shutdown() } // Runnable typically represents a MQTT or HTTP listener Runnable interface { Named Run(ctx context.Contex

Re: [go-nuts] Why would Go not be able put floats in registers without loss of precision?

2023-03-02 Thread 'Grant Seltzer Richman' via golang-nuts
On Thu, Mar 2, 2023 at 12:07 PM Ian Lance Taylor wrote: > > On Thu, Mar 2, 2023 at 8:43 AM 'Grant Seltzer Richman' via golang-nuts > wrote: > > > > So you're saying this should never happen on arm64? That would make sense > > but i'm having trou

Re: [go-nuts] Why would Go not be able put floats in registers without loss of precision?

2023-03-02 Thread 'Grant Seltzer Richman' via golang-nuts
loaded on the stack. On Thursday, March 2, 2023 at 11:34:05 AM UTC-5 Ian Lance Taylor wrote: > On Thu, Mar 2, 2023 at 8:22 AM 'Grant Seltzer Richman' via golang-nuts > wrote: > > > > I'm tracing go functions with uprobes/bpf and printing the contents of > reg

[go-nuts] Why would Go not be able put floats in registers without loss of precision?

2023-03-02 Thread 'Grant Seltzer Richman' via golang-nuts
Hi everyone! I'm tracing go functions with uprobes/bpf and printing the contents of registers/stacks. So I can see the content of registers and stack at the entry of specified go functions. I'm looking at a function with floats as parameters, and what I notice is that sometimes Go puts these v

[go-nuts] Go crashing when run from Jenkins

2020-05-04 Thread Grant Singleton
00097da0) c:/go/src/cmd/go/internal/work/exec.go:168 +0xf4 created by cmd/go/internal/work.(*Builder).Do c:/go/src/cmd/go/internal/work/exec.go:165 +0x391 ``` Go is windows 1.14.2, python is 2.7.17, Jenkins master is 2.204.5 running on Centos I downgraded to go 1.13.10 and the crashes st