Skip to content

Commit 89f8b19

Browse files
[autofix.ci] apply automated fixes
1 parent e5a3a48 commit 89f8b19

File tree

3 files changed

+7
-32
lines changed

3 files changed

+7
-32
lines changed

go.mod

Lines changed: 0 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

go.sum

Lines changed: 0 additions & 22 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/cli_test.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,11 @@ import (
2727
)
2828

2929
// Command-line flag for regenerating snapshots
30-
var regenerateSnapshots = flag.Bool("regenerate-snapshots", false, "Regenerate all golden snapshots")
31-
var startingDir string
32-
var snapshotBaseDir string
30+
var (
31+
regenerateSnapshots = flag.Bool("regenerate-snapshots", false, "Regenerate all golden snapshots")
32+
startingDir string
33+
snapshotBaseDir string
34+
)
3335

3436
// Define styles using lipgloss
3537
var (
@@ -574,11 +576,11 @@ func verifyFileContains(t *testing.T, filePatterns map[string][]MatchPattern) bo
574576
}
575577

576578
func updateSnapshot(fullPath, output string) {
577-
err := os.MkdirAll(filepath.Dir(fullPath), 0755) // Ensure parent directories exist
579+
err := os.MkdirAll(filepath.Dir(fullPath), 0o755) // Ensure parent directories exist
578580
if err != nil {
579581
panic(fmt.Sprintf("Failed to create snapshot directory: %v", err))
580582
}
581-
err = os.WriteFile(fullPath, []byte(output), 0644) // Write snapshot
583+
err = os.WriteFile(fullPath, []byte(output), 0o644) // Write snapshot
582584
if err != nil {
583585
panic(fmt.Sprintf("Failed to write snapshot file: %v", err))
584586
}
@@ -699,7 +701,6 @@ $ go test -run=%q -regenerate-snapshots`, stdoutPath, t.Name())
699701
if isCIEnvironment() || !term.IsTerminal(int(os.Stdout.Fd())) {
700702
// Generate a colorized diff for better readability
701703
diff = generateUnifiedDiff(filteredStdoutActual, filteredStdoutExpected)
702-
703704
} else {
704705
diff = colorizeDiffWithThreshold(filteredStdoutActual, filteredStdoutExpected, 10)
705706
}

0 commit comments

Comments
 (0)