Code snippets with tests and testable examples for the Go programming language
package main import ( "encoding/json" "fmt" ) func Example() { valid := `{"foo":"bar"}` invalid := `}{` fmt.Println(json.Valid([]byte(valid))) fmt.Println(json.Valid([]byte(invalid))) // Output: // true // false }
by psampaz - source code - comment below or here