From a266fba93eda83417b1bd1e42f993f1e368302e1 Mon Sep 17 00:00:00 2001 From: Oleksandr Redko Date: Mon, 24 Feb 2025 14:06:54 +0200 Subject: [PATCH] chore: add linter mirror (#2060) --- .golangci.yml | 1 + task_test.go | 6 +++--- taskfile/snippet.go | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 683230ba..d0953fe9 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -9,6 +9,7 @@ linters: - goimports - gofmt - gofumpt + - mirror - misspell - noctx - paralleltest diff --git a/task_test.go b/task_test.go index 7220bba1..1ff73c23 100644 --- a/task_test.go +++ b/task_test.go @@ -772,7 +772,7 @@ func TestPromptInSummary(t *testing.T) { var outBuff bytes.Buffer var errBuff bytes.Buffer - inBuff.Write([]byte(test.input)) + inBuff.WriteString(test.input) e := task.Executor{ Dir: dir, @@ -802,7 +802,7 @@ func TestPromptWithIndirectTask(t *testing.T) { var outBuff bytes.Buffer var errBuff bytes.Buffer - inBuff.Write([]byte("y\n")) + inBuff.WriteString("y\n") e := task.Executor{ Dir: dir, @@ -839,7 +839,7 @@ func TestPromptAssumeYes(t *testing.T) { var errBuff bytes.Buffer // always cancel the prompt so we can require.Error - inBuff.Write([]byte("\n")) + inBuff.WriteByte('\n') e := task.Executor{ Dir: dir, diff --git a/taskfile/snippet.go b/taskfile/snippet.go index 2db6205d..55deed12 100644 --- a/taskfile/snippet.go +++ b/taskfile/snippet.go @@ -59,7 +59,7 @@ func NewSnippet(b []byte, opts ...SnippetOption) *Snippet { // Syntax highlight the input and split it into lines buf := &bytes.Buffer{} if err := quick.Highlight(buf, string(b), "yaml", "terminal", "task"); err != nil { - buf.WriteString(string(b)) + buf.Write(b) } linesRaw := strings.Split(string(b), "\n") linesHighlighted := strings.Split(buf.String(), "\n")