mirror of
https://github.com/opentofu/opentofu.git
synced 2024-12-27 09:21:14 -06:00
17 lines
263 B
Go
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
|
|
}
|