OSDN Git Service
(root)
/
bytom
/
vapor.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Merge pull request #201 from Bytom/v0.1
[bytom/vapor.git]
/
encoding
/
json
/
json.go
diff --git
a/encoding/json/json.go
b/encoding/json/json.go
index
0ad7b6a
..
02b8078
100644
(file)
--- a/
encoding/json/json.go
+++ b/
encoding/json/json.go
@@
-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) {