I have data set in the environment variable GOPATH and I would like to programatically extract this data in my program. I would prefer to fetch all the ENV variables as a map[string]interface{}
. This is because I want to integrate the ENV values with my JSON config witch I currently fetch like so.
var data map[string]interface{}
file, err := ioutil.ReadFile(configFilePath)
if err != nil {
log.Fatal(err)
}
err = json.Unmarshal(file, &data)
if err != nil {
log.Fatal(err)
}