I am trying to find the best way to convert map[string]string
to type string.
I tried converting to JSON with marshalling to keep the format and then converting back to a string, but this was not successful.
More specifically, I am trying to convert a map containing keys and values to a string to accommodate Environment Variables and structs.go.
For example, the final string should be like
LOG_LEVEL="x"
API_KEY="y"
The map
m := map[string]string{
"LOG_LEVEL": "x",
"API_KEY": "y",
}
true
is not the same as the string"true"
). – Dramatics