Re: [go-nuts] Unexpected order of global variable declaration during package initialization

2022-03-23 Thread Ian Lance Taylor
On Wed, Mar 23, 2022 at 2:01 PM Joao Carlos wrote: > > I'm currently observing a behavior in the package initialization that looks > incompatible with the Go language specification. > Let's consider the following two .go files which are in the same package > > f1.go > package main > > var A int

Re: [go-nuts] Looked at using Go ... nil/SEGV really bothered me .. Go2 Proposal?

2022-03-23 Thread 'Axel Wagner' via golang-nuts
Personally, I think this leads to very unreadable code, for no real benefit. If a nil-pointer dereference happens unexpectedly, that's always a bug. A panic is the correct signal to tell me about that bug, so I can go ahead and fix it. So, making my code less readable to get less robust code seems

Re: [go-nuts] fstest.MapFS ReadDir does not set name field for entry.Name()

2022-03-23 Thread Ian Lance Taylor
On Wed, Mar 23, 2022 at 2:01 PM Kalen Krempely wrote: > > I am trying to use fstest.MapFS to help with testing, but I noticed the mapfs > implementation of ReadDir does not set the name field which is quite > problematic as I rely on that in my code. > > Example Test Code: > t.Run("some test",

[go-nuts] Unexpected order of global variable declaration during package initialization

2022-03-23 Thread Joao Carlos
Hi all, I'm currently observing a behavior in the package initialization that looks incompatible with the Go language specification. Let's consider the following two .go files which are in the same package *f1.go* package main var A int = 3 var B int = A + 1 var C int = A

[go-nuts] Looked at using Go ... nil/SEGV really bothered me .. Go2 Proposal?

2022-03-23 Thread 'Michael Toy' via golang-nuts
I barely understand Go, so this is likely a stupid idea. Since Go uses nil for a lot of things, lots of things can be nil. I am not a huge fan of the null safe accessor. ( https://github.com/golang/go/issues/42847 ) I am a huge fan of the compiler telling me the places where I have not

[go-nuts] fstest.MapFS ReadDir does not set name field for entry.Name()

2022-03-23 Thread Kalen Krempely
I am trying to use fstest.MapFS to help with testing, but I noticed the mapfs implementation of ReadDir does not set the name field which is quite problematic as I rely on that in my

[go-nuts] Creating a shared C library out of go project to be loaded dynamically by other applications (C/Perl/Python) on AIX 7.2

2022-03-23 Thread miecc kn
Hello everyone, first time here so please bear with me. I got the tipp of asking this rather fringe case question here from comments on my /r/golang post. In brief I want to create a shared library out of a golang project so that it can be dynamically loaded by applications written in another

[go-nuts] I have just published my iterator library iter_go : migrated for generics

2022-03-23 Thread Serge Hulne
https://github.com/serge-hulne/go_iter It allows iterating over streams of arbitrary length (data channels). -- 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