int *foo(void) {
int x = 99;
return &x; // bad idea
}
vs. func foo() *int {
x := 99
return &x // fine
}
They think that Go, like C, will allocate x on the stack, and that returning a pointer to the value will therefore be invalid.(Pedants: I'm aware that the official distinction in C is between automatic and non-automatic storage.)