Pull request: replace agherr with golibs' errors

Merge in DNS/adguard-home from golibs-errors to master

Squashed commit of the following:

commit 5aba278a31c5a213bd9e08273ce7277c57713b22
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Mon May 24 17:05:18 2021 +0300

    all: imp code

commit f447eb875b81779fa9e391d98c31c1eeba7ef323
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Mon May 24 15:33:45 2021 +0300

    replace agherr with golibs' errors
This commit is contained in:
Ainar Garipov
2021-05-24 17:28:11 +03:00
parent 14250821ab
commit 03a828ef51
60 changed files with 406 additions and 672 deletions

View File

@@ -75,10 +75,10 @@ esac
# Simple Analyzers
# blocklist_imports is a simple check against unwanted packages. Package
# io/ioutil is soft-deprecated. Package log is replaced by our own package
# github.com/AdguardTeam/golibs/log.
# io/ioutil is soft-deprecated. Packages errors and log are replaced by our own
# packages in the github.com/AdguardTeam/golibs module.
blocklist_imports() {
git grep -F -e '"io/ioutil"' -e '"log"' -- '*.go' || exit 0;
git grep -F -e '"errors"' -e '"io/ioutil"' -e '"log"' -- '*.go' || exit 0;
}
# method_const is a simple check against the usage of some raw strings and
@@ -192,13 +192,7 @@ nilness ./...
exit_on_output shadow --strict ./...
# TODO(a.garipov): Enable errcheck fully after handling all errors, including
# the deferred and generated ones, properly. Also, perhaps, enable --blank.
#
# errcheck ./...
exit_on_output sh -c '
errcheck --asserts --ignoregenerated ./... |\
{ grep -e "defer" -v || exit 0; }
'
# TODO(a.garipov): Enable --blank?
errcheck --asserts ./...
staticcheck ./...