Fix file leak in lll

This commit is contained in:
Denis Isaev 2018-06-29 08:25:48 +03:00
parent 1a9af12d6d
commit 6dd4f07c50
No known key found for this signature in database
GPG Key ID: A36A0EC8E27A1A01
2 changed files with 2 additions and 0 deletions

View File

@ -1,4 +1,5 @@
test:
go install ./cmd/...
GL_TEST_RUN=1 golangci-lint run -v
GL_TEST_RUN=1 golangci-lint run --fast --no-config -v
GL_TEST_RUN=1 golangci-lint run --no-config -v

View File

@ -30,6 +30,7 @@ func (lint Lll) getIssuesForFile(filename string, maxLineLen int) ([]result.Issu
if err != nil {
return nil, fmt.Errorf("can't open file %s: %s", filename, err)
}
defer f.Close()
lineNumber := 1
scanner := bufio.NewScanner(f)