OSDN Git Service

feat: add build crosschain input (#91)
[bytom/vapor.git] / encoding / json / json.go
index 0ad7b6a..02b8078 100644 (file)
@@ -5,6 +5,12 @@ import (
        "encoding/json"
 )
 
+func IsValidJSON(b []byte) bool {
+       var v interface{}
+       err := json.Unmarshal(b, &v)
+       return err == nil
+}
+
 type HexBytes []byte
 
 func (h HexBytes) MarshalText() ([]byte, error) {