I think you are missing the point. Of course you can't assume what a function will do with certainty.
A concept used in lambda calculus, introduced in computing since Lisp exists.
Also part of abstract mathematics field, where operator symbols get defined for the proofs.
From a Go point of view, it isn't.
[1] - According to the language designers own words
It's not exactly magic.