mirror of
https://github.com/opentofu/opentofu.git
synced 2024-12-28 01:41:48 -06:00
Returning a blank string if there's nothing to serialize
This commit is contained in:
parent
277d1b6b2d
commit
459c9a0a5a
@ -37,6 +37,11 @@ func ExpandJsonFromString(jsonString string) (map[string]interface{}, error) {
|
||||
}
|
||||
|
||||
func FlattenJsonToString(input map[string]interface{}) (string, error) {
|
||||
|
||||
if len(input) == 0 {
|
||||
return "", nil
|
||||
}
|
||||
|
||||
result, err := json.Marshal(input)
|
||||
if err != nil {
|
||||
return "", err
|
||||
|
Loading…
Reference in New Issue
Block a user