Lighfer / json-validator

Json-validator does only one thing: verify that the JSON string is valid

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Usage:

validator has only one function: Validate, it returns nil if JSON string is valid, otherwise reutrns the ErrJSON.

func TestValidate_epub(t *testing.T) {
	f, err := os.Open("epub.json")
	if err != nil {
		t.Fatal(err)
	}

	b, _ := ioutil.ReadAll(f)

	if err = Validate(string(b)); err != nil {
		t.Fatal(err)
	}
}

About

Json-validator does only one thing: verify that the JSON string is valid


Languages

Language:Go 100.0%