I am developing a Google App Engine Go application and testing it locally. I have some variables for test environment and some variables for the live App Engine environment. I am wondering whether there is some way to determine from inside the code what environment the code is run in and use a proper version of the variable without having to comment and uncomment code all the time.
Have you read the docs on the runtime environemnt.
It points to this document https://developers.google.com/appengine/docs/go/reference which lists a bunch of functions that give you information about the runtime environemnt.
Specifically
func IsDevAppServer() bool
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With