detect if the string is json
(data string)
| 104 | |
| 105 | // detect if the string is json |
| 106 | func IsJson(data string) bool { |
| 107 | var jsMsg json.RawMessage |
| 108 | return json.Unmarshal([]byte(data), &jsMsg) == nil |
| 109 | } |
| 110 | |
| 111 | // detect if the string is yamlMap |
| 112 | func IsYamlMap(data string) bool { |
no outgoing calls