1
0
mirror of https://github.com/json-iterator/go.git synced 2025-12-20 23:30:38 +02:00

#185 add jsoniter.Valid

This commit is contained in:
Tao Wen
2017-10-10 08:57:02 +08:00
parent 0149a5cf4a
commit 6240e1e798
9 changed files with 36 additions and 17 deletions

View File

@@ -125,3 +125,8 @@ func (adapter *Encoder) SetEscapeHTML(escapeHTML bool) {
config.EscapeHTML = escapeHTML
adapter.stream.cfg = config.Froze().(*frozenConfig)
}
// Valid reports whether data is a valid JSON encoding.
func Valid(data []byte) bool {
return ConfigDefault.Valid(data)
}