Skip to content

Commit 3abe456

Browse files
committed
chore: Remove deadcode
1 parent 50b4e07 commit 3abe456

File tree

1 file changed

+0
-21
lines changed

1 file changed

+0
-21
lines changed

cmd/aoc-cli/main.go

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ package main
44
import (
55
"bytes"
66
"context"
7-
"encoding/json"
87
"errors"
98
"fmt"
109
"os"
@@ -169,26 +168,6 @@ func handlePuzzleChoices(ctx context.Context, year string, opt promptui.Select)
169168
}
170169
}
171170

172-
// PrettyPrint appends to passed struct indents and returns a human-readable form of struct.
173-
// Each element of JSON object will start from indent with prefix.
174-
func PrettyPrint(v interface{}, prefix string, indent string) (string, error) {
175-
b, err := json.Marshal(v)
176-
if err != nil {
177-
return "", fmt.Errorf("failed to marshal: %w", err)
178-
}
179-
180-
var out bytes.Buffer
181-
if err := json.Indent(&out, b, prefix, indent); err != nil {
182-
return "", fmt.Errorf("failed to indent: %w", err)
183-
}
184-
185-
if _, err := out.WriteString("\n"); err != nil {
186-
return "", fmt.Errorf("failed to write string: %w", err)
187-
}
188-
189-
return out.String(), nil
190-
}
191-
192171
func isExit(input string) bool {
193172
return strings.EqualFold(exit, input)
194173
}

0 commit comments

Comments
 (0)