Skip to content

Commit 0866ffd

Browse files
znullCopilot
andcommitted
Fix lint errors
- Remove Go 1.22+ unnecessary loop variable copy (copyloopvar) - Replace unused parameters with _ (revive) - Add nolint directive for FinishEarly naming (staticcheck ST1012) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent fa6c12d commit 0866ffd

3 files changed

Lines changed: 5 additions & 6 deletions

File tree

pipe/pipe_matching_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -360,8 +360,6 @@ func TestPipeTypes(t *testing.T) {
360360
},
361361
},
362362
} {
363-
tc := tc
364-
365363
t.Run(tc.name, func(t *testing.T) {
366364
t.Parallel()
367365

pipe/pipeline.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ type Env struct {
2929
// and is not reported to the caller.
3030
//
3131
//revive:disable:error-naming
32+
//nolint:staticcheck // ST1012: FinishEarly is the intentional name for this sentinel error
3233
var FinishEarly = errors.New("finish stage early")
3334

3435
//revive:enable:error-naming
@@ -68,7 +69,7 @@ type Pipeline struct {
6869
panicHandler StagePanicHandler
6970
}
7071

71-
var emptyEventHandler = func(e *Event) {}
72+
var emptyEventHandler = func(_ *Event) {}
7273

7374
type NewPipeFn func(opts ...Option) *Pipeline
7475

pipe/pipeline_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1007,7 +1007,7 @@ func BenchmarkMoreDataUnbuffered(b *testing.B) {
10071007
p.Add(
10081008
pipe.Function(
10091009
"seq",
1010-
func(ctx context.Context, _ pipe.Env, stdin io.Reader, stdout io.Writer) error {
1010+
func(_ context.Context, _ pipe.Env, stdin io.Reader, stdout io.Writer) error {
10111011
for i := 1; i <= 100000; i++ {
10121012
fmt.Fprintln(stdout, i)
10131013
}
@@ -1025,7 +1025,7 @@ func BenchmarkMoreDataUnbuffered(b *testing.B) {
10251025
pipe.Command("cat"),
10261026
pipe.LinewiseFunction(
10271027
"count",
1028-
func(ctx context.Context, _ pipe.Env, line []byte, stdout *bufio.Writer) error {
1028+
func(_ context.Context, _ pipe.Env, line []byte, stdout *bufio.Writer) error {
10291029
count++
10301030
return nil
10311031
},
@@ -1052,7 +1052,7 @@ func BenchmarkMoreDataBuffered(b *testing.B) {
10521052
p.Add(
10531053
pipe.Function(
10541054
"seq",
1055-
func(ctx context.Context, _ pipe.Env, stdin io.Reader, stdout io.Writer) error {
1055+
func(_ context.Context, _ pipe.Env, stdin io.Reader, stdout io.Writer) error {
10561056
out := bufio.NewWriter(stdout)
10571057
for i := 1; i <= 1000000; i++ {
10581058
fmt.Fprintln(out, i)

0 commit comments

Comments
 (0)