Go - How to properly use DEV and PROD environments?
Hey, is anyone in here a Go professional and could clear up one or two things for me?
Unfortunately that does not work as good with my Tests. I am not sure how to properly check for the environment I am currently in in my tests, as I do not want to test my remote db functionality while developing locally.
- How to properly set up and differentiate between environments?
All I was able to find on my own were functions like:
But that's in code, so that would be pushed to my repository and expose my Turso Database Auth Key for example.
Unfortunately that does not work as good with my Tests. I am not sure how to properly check for the environment I am currently in in my tests, as I do not want to test my remote db functionality while developing locally.
- So how would I avoid running specific tests based on my environment I am currently in?
Would using the
coupled with flags work for that scenario?func init()