Skip to content

Commit

Permalink
fix(*): fix linter errors
Browse files Browse the repository at this point in the history
  • Loading branch information
dbohdan committed Dec 26, 2024
1 parent c374a72 commit 76c64cd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ func run(cfg config) error {
// Ensure we shut down the process.
defer func() {
if cmd.Process != nil {
cmd.Process.Kill()
_ = cmd.Process.Kill()
}
}()

Expand Down
8 changes: 5 additions & 3 deletions main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ func TestDump(t *testing.T) {
os.Remove(dumpPath)

args := append([]string{"-q", "-w", "100", "-d", dumpPath}, getSleepCommand(0.5)...)
runMemsparkline(t, args...)
_, _, _ = runMemsparkline(t, args...)

content, err := os.ReadFile(dumpPath)
if err != nil {
Expand All @@ -215,8 +215,10 @@ func TestDump(t *testing.T) {
t.Error("Expected non-empty dump file")
}

re := regexp.MustCompile(`\d+ \d+`)

for _, line := range lines {
if matched, _ := regexp.MatchString(`\d+ \d+`, line); !matched {
if matched := re.MatchString(line); !matched {
t.Errorf("Invalid line format: %s", line)
}
}
Expand All @@ -229,7 +231,7 @@ func TestOutput(t *testing.T) {

args := append([]string{"-q", "-o", outputPath}, getSleepCommand(0.5)...)
for i := 0; i < 2; i++ {
runMemsparkline(t, args...)
_, _, _ = runMemsparkline(t, args...)
}

content, err := os.ReadFile(outputPath)
Expand Down

0 comments on commit 76c64cd

Please sign in to comment.