Skip to content

Commit c058ff8

Browse files
authored
Merge pull request #17 from github/migue/update-golangci-lint
Move golangci-lint-action to 3.7.0
2 parents 8bfdd5a + 05d708a commit c058ff8

File tree

5 files changed

+35
-21
lines changed

5 files changed

+35
-21
lines changed

.github/workflows/golangci-lint.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ jobs:
1515
- name: Vendor modules for later steps.
1616
run: |
1717
go mod vendor
18-
- uses: golangci/golangci-lint-action@537aa1903e5d359d0b27dbc19ddd22c5087f3fbc # v3.2.0
18+
- uses: golangci/golangci-lint-action@3a919529898de77ec3da873e3063ca4b10e7f5cc # v3.7.0
1919
with:
2020
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
21-
version: v1.49
21+
version: v1.55
22+
args:
23+
-v

.golangci.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,18 @@ linters:
3030
- lll # we allow any line length
3131
- unparam # we allow function calls to name unused parameters
3232
- maligned # clear structs are more important than saving a few bytes.
33+
34+
linters-settings:
35+
depguard:
36+
rules:
37+
main:
38+
files:
39+
- "$all"
40+
- "!$test"
41+
deny:
42+
- pkg: io/ioutil
43+
desc: The io/ioutil package has been deprecated, see https://go.dev/doc/go1.16#ioutil
44+
3345
run:
3446
timeout: 5m
3547
skip-dirs:

pipe/command_linux.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ var (
1616
errProcessInfoMissing = errors.New("cmd.Process is nil")
1717
)
1818

19-
func (s *commandStage) GetRSSAnon(ctx context.Context) (uint64, error) {
19+
func (s *commandStage) GetRSSAnon(_ context.Context) (uint64, error) {
2020
if s.cmd.Process == nil {
2121
return 0, errProcessInfoMissing
2222
}

pipe/iocopier.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ func (s *ioCopier) Name() string {
2727
}
2828

2929
// This method always returns `nil, nil`.
30-
func (s *ioCopier) Start(ctx context.Context, _ Env, r io.ReadCloser) (io.ReadCloser, error) {
30+
func (s *ioCopier) Start(_ context.Context, _ Env, r io.ReadCloser) (io.ReadCloser, error) {
3131
go func() {
3232
_, err := io.Copy(s.w, r)
3333
// We don't consider `ErrClosed` an error (FIXME: is this

pipe/pipeline_test.go

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ func (s ErrorStartingStage) Name() string {
432432
}
433433

434434
func (s ErrorStartingStage) Start(
435-
ctx context.Context, env pipe.Env, stdin io.ReadCloser,
435+
_ context.Context, _ pipe.Env, _ io.ReadCloser,
436436
) (io.ReadCloser, error) {
437437
return io.NopCloser(&bytes.Buffer{}), s.err
438438
}
@@ -854,7 +854,7 @@ func BenchmarkTenFunctions(b *testing.B) {
854854

855855
dir := b.TempDir()
856856

857-
copy := func(_ context.Context, _ pipe.Env, stdin io.Reader, stdout io.Writer) error {
857+
cp := func(_ context.Context, _ pipe.Env, stdin io.Reader, stdout io.Writer) error {
858858
_, err := io.Copy(stdout, stdin)
859859
return err
860860
}
@@ -863,15 +863,15 @@ func BenchmarkTenFunctions(b *testing.B) {
863863
p := pipe.New(pipe.WithDir(dir))
864864
p.Add(
865865
pipe.Println("hello world"),
866-
pipe.Function("copy1", copy),
867-
pipe.Function("copy2", copy),
868-
pipe.Function("copy3", copy),
869-
pipe.Function("copy4", copy),
870-
pipe.Function("copy5", copy),
871-
pipe.Function("copy6", copy),
872-
pipe.Function("copy7", copy),
873-
pipe.Function("copy8", copy),
874-
pipe.Function("copy9", copy),
866+
pipe.Function("copy1", cp),
867+
pipe.Function("copy2", cp),
868+
pipe.Function("copy3", cp),
869+
pipe.Function("copy4", cp),
870+
pipe.Function("copy5", cp),
871+
pipe.Function("copy6", cp),
872+
pipe.Function("copy7", cp),
873+
pipe.Function("copy8", cp),
874+
pipe.Function("copy9", cp),
875875
)
876876
out, err := p.Output(ctx)
877877
if assert.NoError(b, err) {
@@ -885,7 +885,7 @@ func BenchmarkTenMixedStages(b *testing.B) {
885885

886886
dir := b.TempDir()
887887

888-
copy := func(_ context.Context, _ pipe.Env, stdin io.Reader, stdout io.Writer) error {
888+
cp := func(_ context.Context, _ pipe.Env, stdin io.Reader, stdout io.Writer) error {
889889
_, err := io.Copy(stdout, stdin)
890890
return err
891891
}
@@ -894,15 +894,15 @@ func BenchmarkTenMixedStages(b *testing.B) {
894894
p := pipe.New(pipe.WithDir(dir))
895895
p.Add(
896896
pipe.Command("echo", "hello world"),
897-
pipe.Function("copy1", copy),
897+
pipe.Function("copy1", cp),
898898
pipe.Command("cat"),
899-
pipe.Function("copy2", copy),
899+
pipe.Function("copy2", cp),
900900
pipe.Command("cat"),
901-
pipe.Function("copy3", copy),
901+
pipe.Function("copy3", cp),
902902
pipe.Command("cat"),
903-
pipe.Function("copy4", copy),
903+
pipe.Function("copy4", cp),
904904
pipe.Command("cat"),
905-
pipe.Function("copy5", copy),
905+
pipe.Function("copy5", cp),
906906
)
907907
out, err := p.Output(ctx)
908908
if assert.NoError(b, err) {

0 commit comments

Comments
 (0)