[formatting] better example output

This commit is contained in:
Blallo 2018-12-19 14:51:54 +01:00
parent 116cd7b741
commit b57d7b07dd
No known key found for this signature in database
GPG key ID: 0CBE577C9B72DC3F

View file

@ -13,7 +13,9 @@ import (
func showExamples() { func showExamples() {
enc := json.NewEncoder(os.Stderr) enc := json.NewEncoder(os.Stderr)
for i, example := range examples { for i, example := range examples {
fmt.Fprintf(os.Stderr, "\nExample %d:\n%s\n\n", i, example) fmt.Fprintf(os.Stderr, "\nExample %d\n\nInput:\n\n", i)
formatting.PrettyPrint(example)
fmt.Fprintf(os.Stderr, "\nOutput:\n\n")
formatting.EncodeJSON(example, enc) formatting.EncodeJSON(example, enc)
} }
} }