opentofu/helper/structure/flatten_json.go
2017-03-28 12:59:46 +01:00

17 lines
263 B
Go

package structure
import "encoding/json"
func FlattenJsonToString(input map[string]interface{}) (string, error) {
if len(input) == 0 {
return "", nil
}
result, err := json.Marshal(input)
if err != nil {
return "", err
}
return string(result), nil
}