Browse Source

[formatting] better example output

Blallo 5 years ago
parent
commit
b57d7b07dd
1 changed files with 3 additions and 1 deletions
  1. 3 1
      formatting/cmd/path2tree/main.go

+ 3 - 1
formatting/cmd/path2tree/main.go

@@ -13,7 +13,9 @@ import (
 func showExamples() {
 	enc := json.NewEncoder(os.Stderr)
 	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)
 	}
 }