I'm trying to set up templating whereby based on an environment variable to indicate whether we are in a development, staging or production environment, the HTML that is rendered is pointed towards different servers.
To do this I would like to use something like Node does in the NODE_ENV environment variable, and then conditionally set the path based on that in my code.
if(process.env.NODE_ENV === 'development') {
/* development code */
} else {
/* production code */
}
Is there a standard for defining an environment in Golang? Does this seem like a logical approach?