[formatting] better example output
This commit is contained in:
parent
116cd7b741
commit
b57d7b07dd
1 changed files with 3 additions and 1 deletions
|
@ -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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue