Just guessing: your nix might shut down for security reasons by running programs in / tmp. It can be configured on CentOS, but I don't know that.
. , go run Go ( script, C script). ( $GOPATH=~, ) , ..
me:~/src/foo$ go run main.go
me:~/src/foo$ go build
me:~/src/foo$ ./foo
/tmp -whatever , IIRC, .
PS: root. .