Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.golangci.yml1
-rw-r--r--internal/gitaly/linguist/language_stats.go5
2 files changed, 4 insertions, 2 deletions
diff --git a/.golangci.yml b/.golangci.yml
index a80d3f5fc..a8ebf5f14 100644
--- a/.golangci.yml
+++ b/.golangci.yml
@@ -53,7 +53,6 @@ linters-settings:
# eventually fix.
exclude-functions:
# Close
- - (*compress/zlib.Writer).Close
- (*database/sql.DB).Close
- (*database/sql.Rows).Close
- (*github.com/hashicorp/yamux.Session).Close
diff --git a/internal/gitaly/linguist/language_stats.go b/internal/gitaly/linguist/language_stats.go
index e65a90c9a..cefa3b644 100644
--- a/internal/gitaly/linguist/language_stats.go
+++ b/internal/gitaly/linguist/language_stats.go
@@ -135,7 +135,10 @@ func (c *languageStats) save(repo *localrepo.Repo, commitID string) error {
}()
w := zlib.NewWriter(file)
- defer w.Close()
+ defer func() {
+ // We already check the error further down.
+ _ = w.Close()
+ }()
if err = json.NewEncoder(w).Encode(c); err != nil {
return fmt.Errorf("languageStats encode json: %w", err)