Skip to content

Commit 6dd4f07

Browse files
committed
Fix file leak in lll
1 parent 1a9af12 commit 6dd4f07

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

Diff for: Makefile

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
test:
2+
go install ./cmd/...
23
GL_TEST_RUN=1 golangci-lint run -v
34
GL_TEST_RUN=1 golangci-lint run --fast --no-config -v
45
GL_TEST_RUN=1 golangci-lint run --no-config -v

Diff for: pkg/golinters/lll.go

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ func (lint Lll) getIssuesForFile(filename string, maxLineLen int) ([]result.Issu
3030
if err != nil {
3131
return nil, fmt.Errorf("can't open file %s: %s", filename, err)
3232
}
33+
defer f.Close()
3334

3435
lineNumber := 1
3536
scanner := bufio.NewScanner(f)

0 commit comments

Comments
 (0)