Skip to content

Commit a266fba

Browse files
authored
chore: add linter mirror (go-task#2060)
1 parent fb63190 commit a266fba

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

.golangci.yml

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ linters:
99
- goimports
1010
- gofmt
1111
- gofumpt
12+
- mirror
1213
- misspell
1314
- noctx
1415
- paralleltest

task_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -772,7 +772,7 @@ func TestPromptInSummary(t *testing.T) {
772772
var outBuff bytes.Buffer
773773
var errBuff bytes.Buffer
774774

775-
inBuff.Write([]byte(test.input))
775+
inBuff.WriteString(test.input)
776776

777777
e := task.Executor{
778778
Dir: dir,
@@ -802,7 +802,7 @@ func TestPromptWithIndirectTask(t *testing.T) {
802802
var outBuff bytes.Buffer
803803
var errBuff bytes.Buffer
804804

805-
inBuff.Write([]byte("y\n"))
805+
inBuff.WriteString("y\n")
806806

807807
e := task.Executor{
808808
Dir: dir,
@@ -839,7 +839,7 @@ func TestPromptAssumeYes(t *testing.T) {
839839
var errBuff bytes.Buffer
840840

841841
// always cancel the prompt so we can require.Error
842-
inBuff.Write([]byte("\n"))
842+
inBuff.WriteByte('\n')
843843

844844
e := task.Executor{
845845
Dir: dir,

taskfile/snippet.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ func NewSnippet(b []byte, opts ...SnippetOption) *Snippet {
5959
// Syntax highlight the input and split it into lines
6060
buf := &bytes.Buffer{}
6161
if err := quick.Highlight(buf, string(b), "yaml", "terminal", "task"); err != nil {
62-
buf.WriteString(string(b))
62+
buf.Write(b)
6363
}
6464
linesRaw := strings.Split(string(b), "\n")
6565
linesHighlighted := strings.Split(buf.String(), "\n")

0 commit comments

Comments
 (0)