Skip to content

Commit

Permalink
Make indentation fix a private function
Browse files Browse the repository at this point in the history
  • Loading branch information
sethvargo committed Apr 17, 2024
1 parent 4f6b697 commit 7cbb4c1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions command/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ func loadYAMLFiles(fsys fs.FS, paths []string, format bool) (loadResults, error)
}

if format {
if err := FixIndentation(lr); err != nil {
if err := fixIndentation(lr); err != nil {
return nil, fmt.Errorf("failed to format indentation: %w", err)
}
}
Expand All @@ -155,8 +155,8 @@ func loadYAMLFiles(fsys fs.FS, paths []string, format bool) (loadResults, error)
return r, nil
}

// FixIndentation corrects the indentation for the given loadResult and edits it in-place.
func FixIndentation(f *loadResult) error {
// fixIndentation corrects the indentation for the given loadResult and edits it in-place.
func fixIndentation(f *loadResult) error {
updated, err := marshalYAML(f.node)
if err != nil {
return fmt.Errorf("failed to marshal yaml for %s: %w", f.path, err)
Expand Down

0 comments on commit 7cbb4c1

Please sign in to comment.