Просмотр исходного кода

[formatting] better example output

Blallo 5 лет назад
Родитель
Сommit
b57d7b07dd
1 измененных файлов с 3 добавлено и 1 удалено
  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)
 	}
 }