Re: [go-nuts] Re: Error handling

2023-08-03 Thread DrGo
@Miguel Angel Rivera Notararigo Thanks for taking the time to write... In my proposal, people are free to add as much context as they want... but as a demonstration, I am using the example from Ross Cox's paper on error handling that is used by all error handling proposals to show case their

Re: [go-nuts] Re: Error handling

2023-08-03 Thread Miguel Angel Rivera Notararigo
func CopyFile(src, dst string) error { r, err := os.Open(src) if err != nil { return fmt.Errorf("copy %s %s: %v", src, dst, err) } defer r.Close() w, err := os.Create(dst) if err != nil { return fmt.Errorf("copy %s %s: %v", src, dst, err) } if _, err := io.Copy(w, r); err != nil { w.Close() os.Re

[go-nuts] Re: Maybe a Bug? The Go compiler stores a stack pointer into a global object

2023-08-03 Thread Jinbao Chen
Thanks for the relpy. I have opened an issue on github: https://github.com/golang/go/issues/61730 On Thursday, 3 August 2023 at 17:49:25 UTC+8 Michael Knyszek wrote: > That line (the full sentence is "The garbage collector now includes > non-heap sources of garbage collector work (e.g., stack s

Re: [go-nuts] Error handling

2023-08-03 Thread DrGo
I think the proposal goes beyond saving few keystrokes.. as demonstrated in several of my replies above. The issue is readability and avoiding creating new scope with the current shortcut approach if x, err:=fn(); err!=nil. On Wednesday, August 2, 2023 at 2:58:42 PM UTC-6 Wojciech S. Czarnecki

Re: [go-nuts] Error handling

2023-08-03 Thread DrGo
Fully agree.. I think my proposal is targeted primarily at that group although recognizing the strength and ability of group #1 to block any discussion On Wednesday, August 2, 2023 at 1:30:00 PM UTC-6 TheDiveO wrote: > Sorry to f'up on myself, but I would like to add regarding #1: at least my

Re: [go-nuts] Error handling

2023-08-03 Thread DrGo
Great point! Gophers like any human tribes can become victims of absolutest thinking. In the gophers' case, tenets like "there should be only way of doing things" while admirable and justified most of the time can inhibit discussions about possible improvements. There are times where it is perf

Re: [go-nuts] Realpath?

2023-08-03 Thread Carlos Henrique Guardão Gandarez
Hey there! I created a new lib to return a real path in Go. https://github.com/gandarez/go-realpath Thanks. On Thursday, January 18, 2018 at 4:28:09 PM UTC-2 rgo...@redhat.com wrote: > > > On Monday, 16 July 2012 13:55:53 UTC+3, Rémy Oudompheng wrote: >> >> Did you have a look at filepath.EvalS

[go-nuts] Re: Any option to substitute plug-in package ?

2023-08-03 Thread alex-coder
Hi All, Currently I walk through the next book about native go development and find out that it is possible to use the plugin, but with limitations, so it became interesting what alternatives there are. Thank you. четверг, 3 августа 2023 г. в 12:09:21 UTC+3, Christoph Berger: > WebAssembly co

[go-nuts] How to convert an svg to a png (or gif) image?

2023-08-03 Thread 'Mark' via golang-nuts
I know this has been asked before, just wondered if there were any pure-Go solutions? -- 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...@goo

[go-nuts] Re: Maybe a Bug? The Go compiler stores a stack pointer into a global object

2023-08-03 Thread 'Michael Knyszek' via golang-nuts
That line (the full sentence is "The garbage collector now includes non-heap sources of garbage collector work (e.g., stack scanning) when determining how frequently to run.") is unrelated. It only refers to a change in accounting for what gets included in the GOGC calculation, not a change in

[go-nuts] Re: Any option to substitute plug-in package ?

2023-08-03 Thread Christoph Berger
WebAssembly comes to mind - see, for example, https://wazero.io/ A plugin would then be a .wasm binary that can be compiled in any language that supports WebAssembly as target. Disclaimer: I have not yet tried this approach. On Wednesday, August 2, 2023 at 12:14:15 PM UTC+2 alex-coder wrote: H

[go-nuts] Re: Any option to substitute plug-in package ?

2023-08-03 Thread Brian Candler
I believe Hashicorp's go-plugin was developed long before Go's stdlib plugin functionality was made available. But they still use it. It's well established and tested, the architecture has security benefits, and it works cross-platform. It also makes it easier for plugins to be distributed by t