You haven't given the full path to the go compiler.
(In Terminal.app you don't have to do that because a $PATH variable is declared in the the Terminal.app shell environment)
This may be the question most frequently asked in this forum.
See, for example: