From 6dd4f07c50d16f146a9070e89f4f86833bb6319a Mon Sep 17 00:00:00 2001 From: Denis Isaev Date: Fri, 29 Jun 2018 08:25:48 +0300 Subject: [PATCH] Fix file leak in lll --- Makefile | 1 + pkg/golinters/lll.go | 1 + 2 files changed, 2 insertions(+) diff --git a/Makefile b/Makefile index 6378222d..d5734cb5 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/pkg/golinters/lll.go b/pkg/golinters/lll.go index c417438c..a1239576 100644 --- a/pkg/golinters/lll.go +++ b/pkg/golinters/lll.go @@ -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)