If your server is Ubuntu and Apache version is 2.4
Server version: Apache/2.4.29 (Ubuntu)
Then you export variables in "/etc/apache2/envvars" location.
Just like this below line, you need to add an extra line in "/etc/apache2/envvars" export GOROOT=/usr/local/go