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
|
||
|
}
|