golang json字符串有效性校验
import "github.com/ChengjinWu/gojson"
func Test_Validator(t *testing.T) {
data := `{"id":524042,"name":"酷旅-mob-otv-2","male":true,"other":null}`
err := gojson.CheckValid([]byte(data))
if err != nil {
fmt.Println(err)
}
}
github代码库