From 18097edee1aa02382484119dcc6c0fac6be9282e Mon Sep 17 00:00:00 2001
From: Ainar Garipov <a.garipov@adguard.com>
Date: Mon, 11 Jan 2021 15:59:42 +0300
Subject: [PATCH] Pull request: scripts: ignore unchecked errors in generated
 code

Merge in DNS/adguard-home from fix-errcheck to master

Squashed commit of the following:

commit 1cc4e12c1d49612046ce6f0a1b56920ffcad2526
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Mon Jan 11 15:28:42 2021 +0300

    scripts: ignore unchecked errors in generated code
---
 HACKING.md              | 5 +++--
 scripts/make/go-lint.sh | 6 ++++--
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/HACKING.md b/HACKING.md
index 750e5f47..abfa86e8 100644
--- a/HACKING.md
+++ b/HACKING.md
@@ -19,8 +19,9 @@ The rules are mostly sorted in the alphabetical order.
     pkg: fix the network error logging issue
     ```
 
-    Where `pkg` is the package where most changes took place.  If there are
-    several such packages, or the change is top-level only, write `all`.
+    Where `pkg` is the directory or Go package (without the `internal/` part)
+    where most changes took place.  If there are several such packages, or the
+    change is top-level only, write `all`.
 
  *  Keep your commit messages, including headers, to eighty (**80**) columns.
 
diff --git a/scripts/make/go-lint.sh b/scripts/make/go-lint.sh
index 22a57616..417b6b57 100644
--- a/scripts/make/go-lint.sh
+++ b/scripts/make/go-lint.sh
@@ -116,10 +116,12 @@ nilness ./...
 # shadow --strict ./...
 
 # TODO(a.garipov): Enable errcheck fully after handling all errors,
-# including the deferred ones, properly.  Also, perhaps, enable --blank.
+# including the deferred and generated ones, properly.  Also, perhaps,
+# enable --blank.
+#
 # errcheck ./...
 exit_on_output sh -c '
-	errcheck --asserts ./... |\
+	errcheck --asserts --ignoregenerated ./... |\
 		{ grep -e "defer" -e "_test\.go:" -v || exit 0; }
 '