[go-nuts] Idiomatic optional struct fields: zero vs magic value vs bool

2023-12-11 Thread Salvatore Domenick Desiano
I've never really been at peace with using zero values to indicate that a struct field is absent. I use nil (fieldA *int, fieldB *string, etc.) if I have to (I'm looking at you, JSON), but in most other cases the "nil" approach feels dangerous (panics) and magical. Does anyone have an approach

[go-nuts] Re: detecting deleted file that is still open and appending without error in Go?

2023-12-11 Thread Jason E. Aten
Thanks Brian. On Monday, December 11, 2023 at 8:13:26 AM UTC Brian Candler wrote: > On Sunday 10 December 2023 at 16:41:00 UTC Jason E. Aten wrote: > > My question is: is there a way to have the Go process detect if the file > it is writing to has been deleted by another process (git in this

[go-nuts] [ANN] 2023 update to go-recipes collection

2023-12-11 Thread Nikolay Dubina
https://github.com/nikolaydubina/go-recipes Final 2023 update to this collection of tools for Go ecosystem. Now it contains 179 entries, 16 new since last release. New entries are marked with . Hope you find useful! Cheers! Happy holidays everyone! -- Nikolay -- You received this message

[go-nuts] Re: detecting deleted file that is still open and appending without error in Go?

2023-12-11 Thread 'Brian Candler' via golang-nuts
On Sunday 10 December 2023 at 16:41:00 UTC Jason E. Aten wrote: My question is: is there a way to have the Go process detect if the file it is writing to has been deleted by another process (git in this case) so that attempting to append to the file is no longer effective? On Unix, I'd fstat