pointless checking
exit from main body not function
use PE instead of... that
you shall quote
also fail when vars are unset (eg. $GOPATH)