It looks like the language spec is a little imprecise in the
Order of evaluation section about if any function evaluating an index of a slice will always be invoked before anything is done to the slice at that index. That is, if you have something like:
mySlice[someFunc()] = 45
is someFunc() guaranteed to be called before the value at the int it returns is set to 45?
I created a sample test and ran it on 32 different kinds of machines (using Travis CI), including 8 different versions of Go, two different architectures, and two operating systems.
So what are the guarantees, if there are any, about the evaluation order of the inner function verses the slice indexing operation? I want to make sure invalid indexing isn't possible in the kind of code on line 10 in the main.go file in the repo linked to above.
Thanks!