Hello,

> I was trying to get a list of undefined and implementation defined 
> behaviors of the Go language from the specification, but it was not easy.
> I tried to search for "undefined behavior" and "implementation defined 
> behavior" without success.
[...]
> Is this list complete?

The language spec also contains once "unspecified", twice
"implementation-defined" and three times
"implementation-specific".

The exact order in which goroutines are executed is also undefined, see
"method 3" of this funny blog article:
https://blog.merovius.de/2018/01/15/generating_entropy_without_imports_in_go.html

I would also consider the order in which init() functions of the same
package are executed undefined. The spec says they are executed "in the
order they appear in the source, possibly in multiple files, as presented
to the compiler". However, I believe a command like "go run *.go" can
yield different orders, according to the shell, shell settings, or
filesystem charset/collation settings.

Regards,
Harald

-- 
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...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to