docstring_tokens
stringlengths 18
16.9k
| code_tokens
stringlengths 75
1.81M
| html_url
stringlengths 74
116
| file_name
stringlengths 3
311
|
---|---|---|---|
keep replace keep keep keep keep replace keep | <mask> // more than one percent sign.
<mask> errUnexpectedHostFormat agherr.Error = "unexpected host format"
<mask> )
<mask>
<mask> // refreshWithTicker refreshes the cache of sr after each tick form tickCh.
<mask> func refreshWithTicker(sr SystemResolvers, tickCh <-chan time.Time) {
<mask> defer agherr.LogPanic("systemResolvers")
<mask>
</s> 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 </s> remove errFakeDial agherr.Error = "this error signals the successful dialFunc work"
</s> add errFakeDial errors.Error = "this error signals the successful dialFunc work" </s> remove return agherr.Error("more than one question")
</s> add return errors.Error("more than one question") </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add </s> add "github.com/AdguardTeam/golibs/errors" </s> remove return agherr.Error("question is nil")
</s> add return errors.Error("question is nil") | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/aghnet/systemresolvers.go |
keep keep keep keep replace keep keep keep keep keep | <mask> package aghnet
<mask>
<mask> import (
<mask> "context"
<mask> "errors"
<mask> "fmt"
<mask> "net"
<mask> "strings"
<mask> "sync"
<mask> "time"
</s> 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 </s> remove "errors"
</s> add </s> remove "errors"
</s> add </s> remove "errors"
</s> add </s> remove "errors"
</s> add </s> remove "errors"
</s> add </s> remove "errors"
</s> add | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/aghnet/systemresolvers_others.go |
keep keep keep keep replace keep keep keep keep keep | <mask> "strings"
<mask> "sync"
<mask> "time"
<mask>
<mask> "github.com/AdguardTeam/AdGuardHome/internal/agherr"
<mask> "github.com/AdguardTeam/AdGuardHome/internal/aghstrings"
<mask> )
<mask>
<mask> // defaultHostGen is the default method of generating host for Refresh.
<mask> func defaultHostGen() (host string) {
</s> 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 </s> add "github.com/AdguardTeam/golibs/errors" </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add "github.com/AdguardTeam/golibs/errors" </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/aghnet/systemresolvers_others.go |
keep keep add keep keep keep keep keep keep | <mask> "time"
<mask>
<mask> "github.com/AdguardTeam/AdGuardHome/internal/aghstrings"
<mask> )
<mask>
<mask> // defaultHostGen is the default method of generating host for Refresh.
<mask> func defaultHostGen() (host string) {
<mask> // TODO(e.burkov): Use strings.Builder.
<mask> return fmt.Sprintf("test%d.org", time.Now().UnixNano())
</s> 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 </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add </s> remove rDNSNotPTRErr agherr.Error = "the response is not a ptr"
</s> add rDNSNotPTRErr errors.Error = "the response is not a ptr" </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add "github.com/AdguardTeam/golibs/errors" </s> remove defer agherr.LogPanic("systemResolvers")
</s> add defer log.OnPanic("systemResolvers") </s> remove rDNSEmptyAnswerErr agherr.Error = "the answer section is empty"
</s> add rDNSEmptyAnswerErr errors.Error = "the answer section is empty" </s> remove errUnexpectedHostFormat agherr.Error = "unexpected host format"
</s> add errUnexpectedHostFormat errors.Error = "unexpected host format" | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/aghnet/systemresolvers_others.go |
keep keep keep keep replace keep keep keep keep keep | <mask> addrsLock sync.RWMutex
<mask> }
<mask>
<mask> func (sr *systemResolvers) refresh() (err error) {
<mask> defer agherr.Annotate("systemResolvers: %w", &err)
<mask>
<mask> _, err = sr.resolver.LookupHost(context.Background(), sr.hostGenFunc())
<mask> dnserr := &net.DNSError{}
<mask> if errors.As(err, &dnserr) && dnserr.Err == errFakeDial.Error() {
<mask> return nil
</s> 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 </s> remove defer agherr.Annotate("systemResolvers: %w", &err)
</s> add defer func() { err = errors.Annotate(err, "systemResolvers: %w") }() </s> remove defer agherr.Annotate("dhcpv6: %w", &err)
</s> add defer func() { err = errors.Annotate(err, "dhcpv6: %w") }() </s> remove defer agherr.Annotate("dhcpv4: %w", &err)
</s> add defer func() { err = errors.Annotate(err, "dhcpv4: %w") }() </s> remove defer agherr.Annotate("dhcpv4: %w", &err)
</s> add defer func() { err = errors.Annotate(err, "dhcpv4: %w") }() </s> remove defer agherr.Annotate("dhcpv6: %w", &err)
</s> add defer func() { err = errors.Annotate(err, "dhcpv6: %w") }() </s> remove defer agherr.Annotate("dhcpv6: %w", &err)
</s> add defer func() { err = errors.Annotate(err, "dhcpv6: %w") }() | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/aghnet/systemresolvers_others.go |
keep keep keep keep replace keep keep keep keep keep | <mask> }
<mask>
<mask> // validateDialedHost validated the host used by resolvers in dialFunc.
<mask> func validateDialedHost(host string) (err error) {
<mask> defer agherr.Annotate("parsing %q: %w", &err, host)
<mask>
<mask> var ipStr string
<mask> parts := strings.Split(host, "%")
<mask> switch len(parts) {
<mask> case 1:
</s> 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 </s> remove defer agherr.Annotate("invalid option string %q: %w", &err, s)
</s> add defer func() { err = errors.Annotate(err, "invalid option string %q: %w", s) }() </s> remove return agherr.Error("question is nil")
</s> add return errors.Error("question is nil") </s> remove defer agherr.Annotate("validating hardware address %q: %w", &err, hwa)
</s> add defer func() { err = errors.Annotate(err, "validating hardware address %q: %w", hwa) }() </s> remove defer agherr.Annotate("normalizing %q: %w", &err, hostname)
</s> add defer func() { err = errors.Annotate(err, "normalizing %q: %w", hostname) }() </s> remove defer agherr.Annotate("validating domain name %q: %w", &err, name)
</s> add defer func() { err = errors.Annotate(err, "validating domain name %q: %w", name) }() </s> remove return agherr.Error("address is empty")
</s> add return errors.Error("address is empty") | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/aghnet/systemresolvers_others.go |
keep keep keep keep replace keep keep keep keep keep | <mask> "strings"
<mask> "sync"
<mask> "time"
<mask>
<mask> "github.com/AdguardTeam/AdGuardHome/internal/agherr"
<mask> "github.com/AdguardTeam/AdGuardHome/internal/aghio"
<mask> "github.com/AdguardTeam/AdGuardHome/internal/aghos"
<mask> "github.com/AdguardTeam/golibs/log"
<mask> )
<mask>
</s> 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 </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add "github.com/AdguardTeam/golibs/errors" </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add </s> add "github.com/AdguardTeam/golibs/errors" </s> add "github.com/AdguardTeam/golibs/errors" </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/aghnet/systemresolvers_windows.go |
keep keep add keep keep keep keep | <mask>
<mask> "github.com/AdguardTeam/AdGuardHome/internal/aghio"
<mask> "github.com/AdguardTeam/AdGuardHome/internal/aghos"
<mask> "github.com/AdguardTeam/golibs/log"
<mask> )
<mask>
<mask> // systemResolvers implementation differs for Windows since Go's resolver
</s> 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 </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add </s> add "github.com/AdguardTeam/golibs/errors" </s> add "github.com/AdguardTeam/golibs/errors" </s> add "github.com/AdguardTeam/golibs/errors" </s> add "io" </s> add "github.com/AdguardTeam/golibs/errors" | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/aghnet/systemresolvers_windows.go |
keep keep keep keep replace replace keep keep keep keep keep | <mask> if err != nil {
<mask> return nil, fmt.Errorf("getting the command's stdout pipe: %w", err)
<mask> }
<mask>
<mask> var stdoutLimited io.ReadCloser
<mask> stdoutLimited, err = aghio.LimitReadCloser(stdout, aghos.MaxCmdOutputSize)
<mask> if err != nil {
<mask> return nil, fmt.Errorf("limiting stdout reader: %w", err)
<mask> }
<mask>
<mask> go func() {
</s> 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 </s> remove defer agherr.LogPanic("systemResolvers")
</s> add defer log.OnPanic("systemResolvers")
</s> remove defer func() {
_ = f.Close()
}()
</s> add defer func() { err = errors.WithDeferred(err, f.Close()) }() </s> remove defer r.Close()
</s> add defer func() { err = errors.WithDeferred(err, zrc.Close()) }() </s> add defer func() { err = errors.WithDeferred(err, gzReader.Close()) }() </s> remove var files []string
var err2 error
var zr io.ReadCloser
for _, zf := range r.File {
zr, err = zf.Open()
</s> add for _, zf := range zrc.File {
var name string
name, err = zipFileUnpackOne(outDir, zf) </s> remove defer file.Close()
</s> add defer func() { err = errors.WithDeferred(err, file.Close()) }() | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/aghnet/systemresolvers_windows.go |
keep keep keep keep replace keep keep keep keep keep | <mask> return nil, fmt.Errorf("limiting stdout reader: %w", err)
<mask> }
<mask>
<mask> go func() {
<mask> defer agherr.LogPanic("systemResolvers")
<mask> defer func() {
<mask> derr := stdin.Close()
<mask> if derr != nil {
<mask> log.Error("systemResolvers: closing stdin pipe: %s", derr)
<mask> }
</s> 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 </s> remove var stdoutLimited io.ReadCloser
stdoutLimited, err = aghio.LimitReadCloser(stdout, aghos.MaxCmdOutputSize)
</s> add var stdoutLimited io.Reader
stdoutLimited, err = aghio.LimitReader(stdout, aghos.MaxCmdOutputSize) </s> remove defer r.Close()
</s> add defer func() {
derr := r.Close()
if derr != nil {
log.Error("querylog: closing file: %s", err)
}
}() </s> remove defer f.Close()
fileReadCloser, err := aghio.LimitReadCloser(f, MaxFileSize)
</s> add defer func() {
derr := f.Close()
if derr != nil {
log.Error("glinet: closing file: %s", err)
}
}()
fileReader, err := aghio.LimitReader(f, MaxFileSize) </s> remove defer f.Close()
</s> add defer func() {
derr := f.Close()
if derr != nil {
log.Error("querylog: closing file: %s", derr)
}
}() </s> remove defer f.Close()
</s> add defer func() {
derr := f.Close()
if derr != nil {
log.Error("etchostscontainer: closing file: %s", err)
}
}()
</s> remove defer func() {
_ = f.Close()
}()
</s> add defer func() { err = errors.WithDeferred(err, f.Close()) }() | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/aghnet/systemresolvers_windows.go |
keep keep keep keep replace keep keep keep keep keep | <mask> return addrs, nil
<mask> }
<mask>
<mask> func (sr *systemResolvers) refresh() (err error) {
<mask> defer agherr.Annotate("systemResolvers: %w", &err)
<mask>
<mask> got, err := sr.getAddrs()
<mask> if err != nil {
<mask> return fmt.Errorf("can't get addresses: %w", err)
<mask> }
</s> 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 </s> remove defer agherr.Annotate("systemResolvers: %w", &err)
</s> add defer func() { err = errors.Annotate(err, "systemResolvers: %w") }() </s> remove defer agherr.Annotate("dhcpv6: %w", &err)
</s> add defer func() { err = errors.Annotate(err, "dhcpv6: %w") }() </s> remove defer agherr.Annotate("dhcpv4: %w", &err)
</s> add defer func() { err = errors.Annotate(err, "dhcpv4: %w") }() </s> remove defer agherr.Annotate("dhcpv4: %w", &err)
</s> add defer func() { err = errors.Annotate(err, "dhcpv4: %w") }() </s> remove defer agherr.Annotate("dhcpv6: %w", &err)
</s> add defer func() { err = errors.Annotate(err, "dhcpv6: %w") }() </s> remove defer agherr.Annotate("dhcpv6: %w", &err)
</s> add defer func() { err = errors.Annotate(err, "dhcpv6: %w") }() | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/aghnet/systemresolvers_windows.go |
keep keep keep keep replace keep keep keep keep keep | <mask> }
<mask>
<mask> // ReplaceLogLevel sets logging level to l and uses Cleanup method of t to
<mask> // revert changes.
<mask> func ReplaceLogLevel(t *testing.T, l int) {
<mask> switch l {
<mask> case log.INFO, log.DEBUG, log.ERROR:
<mask> // Go on.
<mask> default:
<mask> t.Fatalf("wrong l value (must be one of %v, %v, %v)", log.INFO, log.DEBUG, log.ERROR)
</s> 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 </s> remove return agherr.Error("address is empty")
</s> add return errors.Error("address is empty") </s> remove defer agherr.Annotate("validating label %q: %w", &err, label)
</s> add defer func() { err = errors.Annotate(err, "validating label %q: %w", label) }() </s> remove return agherr.Error("label is empty")
</s> add return errors.Error("label is empty") </s> remove return agherr.Error("domain name is empty")
</s> add return errors.Error("domain name is empty") </s> remove defer agherr.Annotate("validating hardware address %q: %w", &err, hwa)
</s> add defer func() { err = errors.Annotate(err, "validating hardware address %q: %w", hwa) }() </s> remove return agherr.Error("invalid name")
</s> add return errors.Error("invalid name") | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/aghtest/aghtest.go |
keep keep keep keep replace replace replace keep keep keep keep keep | <mask> }
<mask>
<mask> // Exchange always returns nil Msg and non-nil error.
<mask> func (u *TestErrUpstream) Exchange(*dns.Msg) (*dns.Msg, error) {
<mask> // We don't use an agherr.Error to avoid the import cycle since aghtests
<mask> // used to provide the utilities for testing which agherr (and any other
<mask> // testable package) should be able to use.
<mask> return nil, fmt.Errorf("errupstream: %w", u.Err)
<mask> }
<mask>
<mask> // Address always returns an empty string.
<mask> func (u *TestErrUpstream) Address() string {
</s> 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 </s> remove func (u *Updater) downloadPackageFile(url, filename string) error {
resp, err := u.client.Get(url)
</s> add func (u *Updater) downloadPackageFile(url, filename string) (err error) {
var resp *http.Response
resp, err = u.client.Get(url) </s> remove const ErrNoStaticIPInfo agherr.Error = "no information about static ip"
</s> add const ErrNoStaticIPInfo errors.Error = "no information about static ip" </s> remove defer agherr.Annotate("normalizing %q: %w", &err, hostname)
</s> add defer func() { err = errors.Annotate(err, "normalizing %q: %w", hostname) }() </s> remove errBadAddrPassed agherr.Error = "the passed string is not a valid IP address"
</s> add errBadAddrPassed errors.Error = "the passed string is not a valid IP address" </s> remove func (l *queryLog) flushToFile(buffer []*logEntry) error {
</s> add func (l *queryLog) flushToFile(buffer []*logEntry) (err error) { </s> remove func (u *Updater) VersionInfo(forceRecheck bool) (VersionInfo, error) {
</s> add func (u *Updater) VersionInfo(forceRecheck bool) (vi VersionInfo, err error) { | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/aghtest/upstream.go |
keep add keep keep keep keep keep | <mask> "time"
<mask>
<mask> "github.com/AdguardTeam/golibs/log"
<mask> "github.com/insomniacslk/dhcp/dhcpv4"
<mask> "github.com/insomniacslk/dhcp/dhcpv4/nclient4"
<mask> "github.com/insomniacslk/dhcp/dhcpv6"
<mask> "github.com/insomniacslk/dhcp/dhcpv6/nclient6"
</s> 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 </s> add "github.com/AdguardTeam/golibs/errors" </s> add "github.com/AdguardTeam/golibs/errors" </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add </s> add "github.com/AdguardTeam/golibs/errors" </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/dhcpd/checkother.go |
keep keep keep keep replace keep keep keep keep keep | <mask> if err != nil {
<mask> return false, fmt.Errorf("couldn't listen on :68: %w", err)
<mask> }
<mask> if c != nil {
<mask> defer c.Close()
<mask> }
<mask>
<mask> // send to 255.255.255.255:67
<mask> _, err = c.WriteTo(req.ToBytes(), dstAddr)
<mask> if err != nil {
</s> 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 </s> remove defer c.Close()
</s> add defer func() { err = errors.WithDeferred(err, c.Close()) }() </s> remove defer fileReadCloser.Close()
</s> add </s> remove }
</s> add } else if err != nil {
err = fmt.Errorf("tarReader.Next(): %w", err) </s> remove defer f.Close()
</s> add defer func() { err = errors.WithDeferred(err, f.Close()) }() </s> remove return nil, errors.New("couldn't find any legible interface")
</s> add return nil, errors.Error("couldn't find any legible interface") </s> remove has, err = check.checker(fileReadCloser, ifaceName)
</s> add has, err = check.checker(fileReader, ifaceName) | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/dhcpd/checkother.go |
keep keep keep keep replace keep keep keep keep keep | <mask> if err != nil {
<mask> return false, fmt.Errorf("dhcpv6: Couldn't listen on :546: %w", err)
<mask> }
<mask> if c != nil {
<mask> defer c.Close()
<mask> }
<mask>
<mask> _, err = c.WriteTo(req.ToBytes(), dstAddr)
<mask> if err != nil {
<mask> return false, fmt.Errorf("dhcpv6: Couldn't send a packet to %s: %w", dst, err)
</s> 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 </s> remove defer c.Close()
</s> add defer func() { err = errors.WithDeferred(err, c.Close()) }() </s> remove defer fileReadCloser.Close()
</s> add </s> remove defer f.Close()
</s> add defer func() { err = errors.WithDeferred(err, f.Close()) }() </s> remove has, err = check.checker(fileReadCloser, ifaceName)
</s> add has, err = check.checker(fileReader, ifaceName) </s> remove }
</s> add } else if err != nil {
err = fmt.Errorf("tarReader.Next(): %w", err) </s> remove defer resp.Body.Close()
</s> add defer func() { err = errors.WithDeferred(err, resp.Body.Close()) }() | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/dhcpd/checkother.go |
keep keep keep keep replace keep keep keep keep keep | <mask> package dhcpd
<mask>
<mask> import (
<mask> "encoding/json"
<mask> "errors"
<mask> "net"
<mask> "os"
<mask> "time"
<mask>
<mask> "github.com/AdguardTeam/golibs/log"
</s> 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 </s> remove "errors"
</s> add </s> remove "errors"
</s> add </s> remove "errors"
</s> add </s> remove "errors"
</s> add </s> remove "errors"
</s> add </s> remove "errors"
</s> add | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/dhcpd/db.go |
keep add keep keep keep keep keep | <mask> "time"
<mask>
<mask> "github.com/AdguardTeam/golibs/log"
<mask> "github.com/google/renameio/maybe"
<mask> )
<mask>
<mask> const dbFilename = "leases.db"
</s> 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 </s> add "github.com/AdguardTeam/golibs/errors" </s> add "github.com/AdguardTeam/golibs/errors" </s> add "github.com/AdguardTeam/golibs/errors" </s> add "github.com/AdguardTeam/golibs/errors" </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add "github.com/AdguardTeam/golibs/errors" </s> add "github.com/AdguardTeam/golibs/errors" | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/dhcpd/db.go |
keep keep keep keep replace keep keep keep keep keep | <mask> package dhcpd
<mask>
<mask> import (
<mask> "encoding/json"
<mask> "errors"
<mask> "fmt"
<mask> "io"
<mask> "net"
<mask> "net/http"
<mask> "os"
</s> 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 </s> remove "errors"
</s> add </s> remove "errors"
</s> add </s> remove "errors"
</s> add </s> remove "errors"
</s> add </s> remove "errors"
</s> add </s> remove "errors"
</s> add | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/dhcpd/http.go |
keep keep add keep keep keep keep | <mask> "strings"
<mask>
<mask> "github.com/AdguardTeam/AdGuardHome/internal/aghnet"
<mask> "github.com/AdguardTeam/golibs/log"
<mask> )
<mask>
<mask> func httpError(r *http.Request, w http.ResponseWriter, code int, format string, args ...interface{}) {
</s> 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 </s> add "github.com/AdguardTeam/golibs/errors" </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add </s> add "github.com/AdguardTeam/golibs/errors" </s> add "github.com/AdguardTeam/golibs/errors" | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/dhcpd/http.go |
keep keep keep keep replace keep keep keep keep keep | <mask> "math"
<mask> "math/big"
<mask> "net"
<mask>
<mask> "github.com/AdguardTeam/AdGuardHome/internal/agherr"
<mask> )
<mask>
<mask> // ipRange is an inclusive range of IP addresses. A nil range is a range that
<mask> // doesn't contain any IP addresses.
<mask> //
</s> 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 </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add "github.com/AdguardTeam/golibs/errors" </s> remove errBadAddrPassed agherr.Error = "the passed string is not a valid IP address"
</s> add errBadAddrPassed errors.Error = "the passed string is not a valid IP address" </s> remove errFakeDial agherr.Error = "this error signals the successful dialFunc work"
</s> add errFakeDial errors.Error = "this error signals the successful dialFunc work" </s> remove const ErrNoStaticIPInfo agherr.Error = "no information about static ip"
</s> add const ErrNoStaticIPInfo errors.Error = "no information about static ip" </s> remove defer agherr.Annotate("invalid ip range: %w", &err)
</s> add defer func() { err = errors.Annotate(err, "invalid ip range: %w") }() </s> remove defer agherr.LogPanic("rdns")
</s> add defer log.OnPanic("rdns") | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/dhcpd/iprange.go |
keep keep keep keep replace keep keep keep keep keep | <mask>
<mask> // newIPRange creates a new IP address range. start must be less than end. The
<mask> // resulting range must not be greater than maxRangeLen.
<mask> func newIPRange(start, end net.IP) (r *ipRange, err error) {
<mask> defer agherr.Annotate("invalid ip range: %w", &err)
<mask>
<mask> // Make sure that both are 16 bytes long to simplify handling in
<mask> // methods.
<mask> start, end = start.To16(), end.To16()
<mask>
</s> 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 </s> remove defer agherr.Annotate("bad upstream for domain spec %q: %w", &err, upstreamStr)
</s> add defer func() { err = errors.Annotate(err, "bad upstream for domain spec %q: %w", upstreamStr) }() </s> remove defer agherr.LogPanic("rdns")
</s> add defer log.OnPanic("rdns") </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add "github.com/AdguardTeam/golibs/errors" </s> remove h.ServeHTTP(w, r)
</s> add // HTTP handlers aren't supposed to call r.Body.Close(), so just
// replace the body in a clone.
rr := r.Clone(r.Context())
rr.Body = io.NopCloser(reader)
h.ServeHTTP(w, rr) </s> remove defer agherr.Annotate("dhcpv6: %w", &err)
</s> add defer func() { err = errors.Annotate(err, "dhcpv6: %w") }() </s> remove defer agherr.Annotate("dhcpv6: %w", &err)
</s> add defer func() { err = errors.Annotate(err, "dhcpv6: %w") }() | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/dhcpd/iprange.go |
keep keep keep keep replace keep keep keep keep keep | <mask> "net"
<mask> "strconv"
<mask> "strings"
<mask>
<mask> "github.com/AdguardTeam/AdGuardHome/internal/agherr"
<mask> )
<mask>
<mask> // hexDHCPOptionParserHandler parses a DHCP option as a hex-encoded string.
<mask> // For example:
<mask> //
</s> 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 </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add "github.com/AdguardTeam/golibs/errors" </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add "github.com/AdguardTeam/golibs/errors" </s> add "github.com/AdguardTeam/golibs/errors" </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add "github.com/AdguardTeam/golibs/errors" | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/dhcpd/options.go |
keep keep keep keep replace keep keep keep keep keep | <mask> //
<mask> func ipDHCPOptionParserHandler(s string) (data []byte, err error) {
<mask> ip := net.ParseIP(s)
<mask> if ip == nil {
<mask> return nil, agherr.Error("invalid ip")
<mask> }
<mask>
<mask> // Most DHCP options require IPv4, so do not put the 16-byte
<mask> // version if we can. Otherwise, the clients will receive weird
<mask> // data that looks like four IPv4 addresses.
</s> 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 </s> remove defer agherr.Annotate("dhcpv4: %w", &err)
</s> add defer func() { err = errors.Annotate(err, "dhcpv4: %w") }() </s> remove func (w *Whois) query(ctx context.Context, target, serverAddr string) (string, error) {
</s> add func (w *Whois) query(ctx context.Context, target, serverAddr string) (data string, err error) { </s> remove defer agherr.Annotate("invalid ip range: %w", &err)
</s> add defer func() { err = errors.Annotate(err, "invalid ip range: %w") }() </s> remove func tarGzFileUnpack(tarfile, outdir string) ([]string, error) {
</s> add func tarGzFileUnpack(tarfile, outDir string) (files []string, err error) { </s> remove defer agherr.Annotate("invalid option string %q: %w", &err, s)
</s> add defer func() { err = errors.Annotate(err, "invalid option string %q: %w", s) }() </s> remove func zipFileUnpack(zipfile, outdir string) ([]string, error) {
r, err := zip.OpenReader(zipfile)
</s> add func zipFileUnpack(zipfile, outDir string) (files []string, err error) {
zrc, err := zip.OpenReader(zipfile) | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/dhcpd/options.go |
keep keep replace keep keep keep keep replace keep keep keep | <mask> // parse parses an option. See the handlers' documentation for more info.
<mask> func (p *dhcpOptionParser) parse(s string) (code uint8, data []byte, err error) {
<mask> defer agherr.Annotate("invalid option string %q: %w", &err, s)
<mask>
<mask> s = strings.TrimSpace(s)
<mask> parts := strings.SplitN(s, " ", 3)
<mask> if len(parts) < 3 {
<mask> return 0, nil, agherr.Error("need at least three fields")
<mask> }
<mask>
<mask> codeStr := parts[0]
</s> 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 </s> remove defer agherr.Annotate("parsing %q: %w", &err, host)
</s> add defer func() { err = errors.Annotate(err, "parsing %q: %w", host) }() </s> remove defer agherr.Annotate("normalizing %q: %w", &err, hostname)
</s> add defer func() { err = errors.Annotate(err, "normalizing %q: %w", hostname) }() </s> remove return "", false, agherr.Error("duplicated separator")
</s> add return "", false, errors.Error("duplicated separator") </s> remove defer agherr.Annotate("bad upstream for domain spec %q: %w", &err, upstreamStr)
</s> add defer func() { err = errors.Annotate(err, "bad upstream for domain spec %q: %w", upstreamStr) }() </s> remove return nil, agherr.Error("invalid ip")
</s> add return nil, errors.Error("invalid ip") | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/dhcpd/options.go |
keep keep keep replace keep keep keep keep keep | <mask> package dhcpd
<mask>
<mask> import (
<mask> "errors"
<mask> "net"
<mask>
<mask> "golang.org/x/net/ipv4"
<mask> )
<mask>
</s> 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 </s> remove "errors"
</s> add </s> remove "errors"
</s> add </s> remove "errors"
</s> add </s> remove "errors"
</s> add </s> remove "errors"
</s> add </s> remove "errors"
</s> add | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/dhcpd/os_windows.go |
keep keep keep add keep keep keep keep keep | <mask>
<mask> import (
<mask> "net"
<mask>
<mask> "golang.org/x/net/ipv4"
<mask> )
<mask>
<mask> // Create a socket for receiving broadcast packets
<mask> func newBroadcastPacketConn(bindAddr net.IP, port int, ifname string) (*ipv4.PacketConn, error) {
</s> 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 </s> remove return nil, errors.New("newBroadcastPacketConn(): not supported on Windows")
</s> add return nil, errors.Error("newBroadcastPacketConn(): not supported on Windows") </s> remove "errors"
</s> add </s> remove "errors"
</s> add </s> add "github.com/AdguardTeam/golibs/errors" </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add </s> remove func (w *Whois) query(ctx context.Context, target, serverAddr string) (string, error) {
</s> add func (w *Whois) query(ctx context.Context, target, serverAddr string) (data string, err error) { | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/dhcpd/os_windows.go |
keep keep keep keep replace keep | <mask> )
<mask>
<mask> // Create a socket for receiving broadcast packets
<mask> func newBroadcastPacketConn(bindAddr net.IP, port int, ifname string) (*ipv4.PacketConn, error) {
<mask> return nil, errors.New("newBroadcastPacketConn(): not supported on Windows")
<mask> }
</s> 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 </s> add "github.com/AdguardTeam/golibs/errors" </s> remove return agherr.Error("lease not found")
</s> add return errors.Error("lease not found") </s> remove defer agherr.Annotate("normalizing %q: %w", &err, hostname)
</s> add defer func() { err = errors.Annotate(err, "normalizing %q: %w", hostname) }() </s> remove func tarGzFileUnpack(tarfile, outdir string) ([]string, error) {
</s> add func tarGzFileUnpack(tarfile, outDir string) (files []string, err error) { </s> remove return nil, agherr.Error("invalid ip")
</s> add return nil, errors.Error("invalid ip") </s> remove func zipFileUnpack(zipfile, outdir string) ([]string, error) {
r, err := zip.OpenReader(zipfile)
</s> add func zipFileUnpack(zipfile, outDir string) (files []string, err error) {
zrc, err := zip.OpenReader(zipfile) | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/dhcpd/os_windows.go |
keep keep keep keep replace keep keep keep keep keep | <mask> package dhcpd
<mask>
<mask> import (
<mask> "bytes"
<mask> "errors"
<mask> "fmt"
<mask> "net"
<mask> "strings"
<mask> "sync"
<mask> "time"
</s> 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 </s> remove "errors"
</s> add </s> remove "errors"
</s> add </s> remove "errors"
</s> add </s> remove "errors"
</s> add </s> remove "errors"
</s> add </s> remove "errors"
</s> add | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/dhcpd/v4.go |
keep keep keep keep replace keep keep keep keep keep | <mask> "strings"
<mask> "sync"
<mask> "time"
<mask>
<mask> "github.com/AdguardTeam/AdGuardHome/internal/agherr"
<mask> "github.com/AdguardTeam/AdGuardHome/internal/aghnet"
<mask> "github.com/AdguardTeam/AdGuardHome/internal/aghstrings"
<mask> "github.com/AdguardTeam/golibs/log"
<mask> "github.com/go-ping/ping"
<mask> "github.com/insomniacslk/dhcp/dhcpv4"
</s> 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 </s> add "github.com/AdguardTeam/golibs/errors" </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/dhcpd/v4.go |
keep keep keep add keep keep keep keep | <mask> "time"
<mask>
<mask> "github.com/AdguardTeam/AdGuardHome/internal/aghnet"
<mask> "github.com/AdguardTeam/AdGuardHome/internal/aghstrings"
<mask> "github.com/AdguardTeam/golibs/log"
<mask> "github.com/go-ping/ping"
<mask> "github.com/insomniacslk/dhcp/dhcpv4"
<mask> "github.com/insomniacslk/dhcp/dhcpv4/server4"
</s> 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 </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add </s> add "github.com/AdguardTeam/golibs/errors" </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add </s> add "github.com/AdguardTeam/golibs/errors" | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/dhcpd/v4.go |
keep keep keep keep replace keep keep keep keep keep | <mask>
<mask> // normalizeHostname normalizes a hostname sent by the client. If err is not
<mask> // nil, norm is an empty string.
<mask> func normalizeHostname(hostname string) (norm string, err error) {
<mask> defer agherr.Annotate("normalizing %q: %w", &err, hostname)
<mask>
<mask> if hostname == "" {
<mask> return "", nil
<mask> }
<mask>
</s> 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 </s> remove defer agherr.Annotate("validating label %q: %w", &err, label)
</s> add defer func() { err = errors.Annotate(err, "validating label %q: %w", label) }() </s> remove defer agherr.Annotate("bad upstream for domain spec %q: %w", &err, upstreamStr)
</s> add defer func() { err = errors.Annotate(err, "bad upstream for domain spec %q: %w", upstreamStr) }() </s> remove defer agherr.Annotate("parsing %q: %w", &err, host)
</s> add defer func() { err = errors.Annotate(err, "parsing %q: %w", host) }() </s> remove defer agherr.Annotate("validating hardware address %q: %w", &err, hwa)
</s> add defer func() { err = errors.Annotate(err, "validating hardware address %q: %w", hwa) }() </s> remove rDNSNotPTRErr agherr.Error = "the response is not a ptr"
</s> add rDNSNotPTRErr errors.Error = "the response is not a ptr" </s> remove defer agherr.Annotate("invalid option string %q: %w", &err, s)
</s> add defer func() { err = errors.Annotate(err, "invalid option string %q: %w", s) }() | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/dhcpd/v4.go |
keep keep keep keep replace keep keep keep keep keep | <mask> l := s.leases[i]
<mask>
<mask> if bytes.Equal(l.HWAddr, lease.HWAddr) {
<mask> if l.IsStatic() {
<mask> return agherr.Error("static lease already exists")
<mask> }
<mask>
<mask> s.rmLeaseByIndex(i)
<mask> if i == len(s.leases) {
<mask> break
</s> 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 </s> remove return agherr.Error("static lease already exists")
</s> add return errors.Error("static lease already exists") </s> remove return agherr.Error("client already exists")
</s> add return errors.Error("client already exists") </s> remove return agherr.Error("label is empty")
</s> add return errors.Error("label is empty") </s> remove return agherr.Error("domain name is empty")
</s> add return errors.Error("domain name is empty") </s> remove _, inputNameOnly := filepath.Split(header.Name)
if inputNameOnly == "" {
continue
</s> add break </s> remove return errors.New("IP address is already static")
</s> add return errors.Error("IP address is already static") | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/dhcpd/v4.go |
keep keep keep keep replace keep keep keep keep keep | <mask> }
<mask>
<mask> if l.IP.Equal(lease.IP) {
<mask> if l.IsStatic() {
<mask> return agherr.Error("static lease already exists")
<mask> }
<mask>
<mask> s.rmLeaseByIndex(i)
<mask> if i == len(s.leases) {
<mask> break
</s> 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 </s> remove return agherr.Error("static lease already exists")
</s> add return errors.Error("static lease already exists") </s> remove return agherr.Error("client already exists")
</s> add return errors.Error("client already exists") </s> remove _, inputNameOnly := filepath.Split(header.Name)
if inputNameOnly == "" {
continue
</s> add break </s> remove return errors.New("IP address is already static")
</s> add return errors.Error("IP address is already static") </s> remove }
</s> add } else if err != nil {
err = fmt.Errorf("tarReader.Next(): %w", err) </s> remove var header *tar.Header
header, err = tarReader.Next()
if err == io.EOF {
err2 = nil
break
}
if err != nil {
err2 = fmt.Errorf("tarReader.Next(): %w", err)
</s> add var hdr *tar.Header
hdr, err = tarReader.Next()
if errors.Is(err, io.EOF) {
err = nil
| https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/dhcpd/v4.go |
keep keep keep replace keep keep keep keep replace keep keep keep keep | <mask> }
<mask> }
<mask>
<mask> return agherr.Error("lease not found")
<mask> }
<mask>
<mask> // AddStaticLease adds a static lease. It is safe for concurrent use.
<mask> func (s *v4Server) AddStaticLease(l Lease) (err error) {
<mask> defer agherr.Annotate("dhcpv4: adding static lease: %w", &err)
<mask>
<mask> if ip4 := l.IP.To4(); ip4 == nil {
<mask> return fmt.Errorf("invalid ip %q, only ipv4 is supported", l.IP)
<mask> }
</s> 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 </s> remove defer agherr.Annotate("dhcpv6: %w", &err)
</s> add defer func() { err = errors.Annotate(err, "dhcpv6: %w") }() </s> remove defer agherr.Annotate("dhcpv4: %w", &err)
</s> add defer func() { err = errors.Annotate(err, "dhcpv4: %w") }() </s> remove defer agherr.Annotate("dhcpv6: %w", &err)
</s> add defer func() { err = errors.Annotate(err, "dhcpv6: %w") }() </s> remove defer agherr.Annotate("dhcpv4: %w", &err)
</s> add defer func() { err = errors.Annotate(err, "dhcpv4: %w") }() </s> remove defer agherr.Annotate("dhcpv6: %w", &err)
</s> add defer func() { err = errors.Annotate(err, "dhcpv6: %w") }() | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/dhcpd/v4.go |
keep keep keep keep replace keep keep keep keep keep | <mask> }
<mask>
<mask> // RemoveStaticLease removes a static lease. It is safe for concurrent use.
<mask> func (s *v4Server) RemoveStaticLease(l Lease) (err error) {
<mask> defer agherr.Annotate("dhcpv4: %w", &err)
<mask>
<mask> if len(l.IP) != 4 {
<mask> return fmt.Errorf("invalid IP")
<mask> }
<mask>
</s> 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 </s> remove defer agherr.Annotate("dhcpv6: %w", &err)
</s> add defer func() { err = errors.Annotate(err, "dhcpv6: %w") }() </s> remove defer agherr.Annotate("dhcpv6: %w", &err)
</s> add defer func() { err = errors.Annotate(err, "dhcpv6: %w") }() </s> remove return agherr.Error("lease not found")
</s> add return errors.Error("lease not found") </s> remove defer agherr.Annotate("dhcpv4: adding static lease: %w", &err)
</s> add defer func() { err = errors.Annotate(err, "dhcpv4: adding static lease: %w") }() </s> remove defer agherr.Annotate("dhcpv4: %w", &err)
</s> add defer func() { err = errors.Annotate(err, "dhcpv4: %w") }() </s> remove defer agherr.Annotate("dhcpv6: %w", &err)
</s> add defer func() { err = errors.Annotate(err, "dhcpv6: %w") }() | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/dhcpd/v4.go |
keep keep keep keep replace keep keep keep keep keep | <mask> }
<mask>
<mask> // Start starts the IPv4 DHCP server.
<mask> func (s *v4Server) Start() (err error) {
<mask> defer agherr.Annotate("dhcpv4: %w", &err)
<mask>
<mask> if !s.conf.Enabled {
<mask> return nil
<mask> }
<mask>
</s> 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 </s> remove defer agherr.Annotate("dhcpv6: %w", &err)
</s> add defer func() { err = errors.Annotate(err, "dhcpv6: %w") }() </s> remove defer agherr.Annotate("dhcpv4: %w", &err)
</s> add defer func() { err = errors.Annotate(err, "dhcpv4: %w") }() </s> remove return agherr.Error("lease not found")
</s> add return errors.Error("lease not found") </s> remove defer agherr.Annotate("dhcpv4: adding static lease: %w", &err)
</s> add defer func() { err = errors.Annotate(err, "dhcpv4: adding static lease: %w") }() </s> remove defer agherr.Annotate("dhcpv6: %w", &err)
</s> add defer func() { err = errors.Annotate(err, "dhcpv6: %w") }() </s> remove defer agherr.Annotate("dhcpv6: %w", &err)
</s> add defer func() { err = errors.Annotate(err, "dhcpv6: %w") }() | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/dhcpd/v4.go |
keep keep keep replace keep keep keep replace keep keep | <mask> package dhcpd
<mask>
<mask> import (
<mask> "errors"
<mask> "net"
<mask> "testing"
<mask>
<mask> "github.com/AdguardTeam/AdGuardHome/internal/agherr"
<mask> "github.com/stretchr/testify/assert"
<mask> "github.com/stretchr/testify/require"
</s> 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 </s> remove "errors"
</s> add </s> remove "errors"
</s> add </s> remove "errors"
</s> add </s> remove "errors"
</s> add </s> remove "errors"
</s> add | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/dhcpd/v46_test.go |
keep keep keep keep replace keep keep keep keep keep | <mask> return iface.addrs, nil
<mask> }
<mask>
<mask> func TestIfaceIPAddrs(t *testing.T) {
<mask> const errTest agherr.Error = "test error"
<mask>
<mask> ip4 := net.IP{1, 2, 3, 4}
<mask> addr4 := &net.IPNet{IP: ip4}
<mask>
<mask> ip6 := net.IP{1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6}
</s> 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 </s> remove const errTest agherr.Error = "test error"
</s> add const errTest errors.Error = "test error" </s> remove return agherr.Error("address is empty")
</s> add return errors.Error("address is empty") </s> remove return 0, nil, agherr.Error("need at least three fields")
</s> add return 0, nil, errors.Error("need at least three fields") </s> remove defer agherr.Annotate("dhcpv4: adding static lease: %w", &err)
</s> add defer func() { err = errors.Annotate(err, "dhcpv4: adding static lease: %w") }() </s> remove defer agherr.Annotate("validating hardware address %q: %w", &err, hwa)
</s> add defer func() { err = errors.Annotate(err, "validating hardware address %q: %w", hwa) }() </s> remove defer agherr.Annotate("invalid option string %q: %w", &err, s)
</s> add defer func() { err = errors.Annotate(err, "invalid option string %q: %w", s) }() | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/dhcpd/v46_test.go |
keep keep keep keep replace keep keep keep keep keep | <mask> return nil, nil
<mask> }
<mask>
<mask> func TestIfaceDNSIPAddrs(t *testing.T) {
<mask> const errTest agherr.Error = "test error"
<mask>
<mask> ip4 := net.IP{1, 2, 3, 4}
<mask> addr4 := &net.IPNet{IP: ip4}
<mask>
<mask> ip6 := net.IP{1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6}
</s> 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 </s> remove const errTest agherr.Error = "test error"
</s> add const errTest errors.Error = "test error" </s> remove return 0, nil, agherr.Error("need at least three fields")
</s> add return 0, nil, errors.Error("need at least three fields") </s> remove return agherr.Error("address is empty")
</s> add return errors.Error("address is empty") </s> remove defer agherr.Annotate("dhcpv4: adding static lease: %w", &err)
</s> add defer func() { err = errors.Annotate(err, "dhcpv4: adding static lease: %w") }() </s> remove defer agherr.Annotate("validating hardware address %q: %w", &err, hwa)
</s> add defer func() { err = errors.Annotate(err, "validating hardware address %q: %w", hwa) }() </s> remove return nil, "", errors.New("tls: failed to parse private key")
</s> add return nil, "", errors.Error("tls: failed to parse private key") | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/dhcpd/v46_test.go |
keep keep keep keep replace keep keep keep keep keep | <mask> "net"
<mask> "sync"
<mask> "time"
<mask>
<mask> "github.com/AdguardTeam/AdGuardHome/internal/agherr"
<mask> "github.com/AdguardTeam/AdGuardHome/internal/aghnet"
<mask> "github.com/AdguardTeam/golibs/log"
<mask> "github.com/insomniacslk/dhcp/dhcpv6"
<mask> "github.com/insomniacslk/dhcp/dhcpv6/server6"
<mask> "github.com/insomniacslk/dhcp/iana"
</s> 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 </s> add "github.com/AdguardTeam/golibs/errors" </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/dhcpd/v6.go |
keep keep add keep keep keep keep keep keep | <mask> "time"
<mask>
<mask> "github.com/AdguardTeam/AdGuardHome/internal/aghnet"
<mask> "github.com/AdguardTeam/golibs/log"
<mask> "github.com/insomniacslk/dhcp/dhcpv6"
<mask> "github.com/insomniacslk/dhcp/dhcpv6/server6"
<mask> "github.com/insomniacslk/dhcp/iana"
<mask> )
<mask>
</s> 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 </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add </s> add "github.com/AdguardTeam/golibs/errors" </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add </s> add "github.com/AdguardTeam/golibs/errors" </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add </s> add "github.com/AdguardTeam/golibs/errors" | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/dhcpd/v6.go |
keep keep keep keep replace keep keep keep keep keep | <mask> }
<mask>
<mask> // AddStaticLease adds a static lease. It is safe for concurrent use.
<mask> func (s *v6Server) AddStaticLease(l Lease) (err error) {
<mask> defer agherr.Annotate("dhcpv6: %w", &err)
<mask>
<mask> if len(l.IP) != 16 {
<mask> return fmt.Errorf("invalid IP")
<mask> }
<mask>
</s> 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 </s> remove defer agherr.Annotate("dhcpv6: %w", &err)
</s> add defer func() { err = errors.Annotate(err, "dhcpv6: %w") }() </s> remove return agherr.Error("lease not found")
</s> add return errors.Error("lease not found") </s> remove defer agherr.Annotate("dhcpv4: %w", &err)
</s> add defer func() { err = errors.Annotate(err, "dhcpv4: %w") }() </s> remove defer agherr.Annotate("dhcpv4: adding static lease: %w", &err)
</s> add defer func() { err = errors.Annotate(err, "dhcpv4: adding static lease: %w") }() </s> remove defer agherr.Annotate("dhcpv6: %w", &err)
</s> add defer func() { err = errors.Annotate(err, "dhcpv6: %w") }() </s> remove defer agherr.Annotate("dhcpv4: %w", &err)
</s> add defer func() { err = errors.Annotate(err, "dhcpv4: %w") }() | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/dhcpd/v6.go |
keep keep keep keep replace keep keep keep keep keep | <mask> }
<mask>
<mask> // RemoveStaticLease removes a static lease. It is safe for concurrent use.
<mask> func (s *v6Server) RemoveStaticLease(l Lease) (err error) {
<mask> defer agherr.Annotate("dhcpv6: %w", &err)
<mask>
<mask> if len(l.IP) != 16 {
<mask> return fmt.Errorf("invalid IP")
<mask> }
<mask>
</s> 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 </s> remove defer agherr.Annotate("dhcpv4: %w", &err)
</s> add defer func() { err = errors.Annotate(err, "dhcpv4: %w") }() </s> remove defer agherr.Annotate("dhcpv6: %w", &err)
</s> add defer func() { err = errors.Annotate(err, "dhcpv6: %w") }() </s> remove return agherr.Error("lease not found")
</s> add return errors.Error("lease not found") </s> remove defer agherr.Annotate("dhcpv4: adding static lease: %w", &err)
</s> add defer func() { err = errors.Annotate(err, "dhcpv4: adding static lease: %w") }() </s> remove defer agherr.Annotate("dhcpv6: %w", &err)
</s> add defer func() { err = errors.Annotate(err, "dhcpv6: %w") }() </s> remove defer agherr.Annotate("dhcpv4: %w", &err)
</s> add defer func() { err = errors.Annotate(err, "dhcpv4: %w") }() | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/dhcpd/v6.go |
keep keep keep keep replace keep keep keep keep keep | <mask> }
<mask>
<mask> // Start starts the IPv6 DHCP server.
<mask> func (s *v6Server) Start() (err error) {
<mask> defer agherr.Annotate("dhcpv6: %w", &err)
<mask>
<mask> if !s.conf.Enabled {
<mask> return nil
<mask> }
<mask>
</s> 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 </s> remove defer agherr.Annotate("dhcpv4: %w", &err)
</s> add defer func() { err = errors.Annotate(err, "dhcpv4: %w") }() </s> remove defer agherr.Annotate("dhcpv6: %w", &err)
</s> add defer func() { err = errors.Annotate(err, "dhcpv6: %w") }() </s> remove defer agherr.Annotate("dhcpv6: %w", &err)
</s> add defer func() { err = errors.Annotate(err, "dhcpv6: %w") }() </s> remove defer agherr.Annotate("dhcpv4: %w", &err)
</s> add defer func() { err = errors.Annotate(err, "dhcpv4: %w") }() </s> remove return agherr.Error("lease not found")
</s> add return errors.Error("lease not found") </s> remove defer agherr.Annotate("systemResolvers: %w", &err)
</s> add defer func() { err = errors.Annotate(err, "systemResolvers: %w") }() | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/dhcpd/v6.go |
keep keep keep keep replace keep keep keep keep keep | <mask> package dnsforward
<mask>
<mask> import (
<mask> "crypto/tls"
<mask> "errors"
<mask> "fmt"
<mask> "path"
<mask> "strings"
<mask>
<mask> "github.com/AdguardTeam/AdGuardHome/internal/aghnet"
</s> 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 </s> remove "errors"
</s> add </s> remove "errors"
</s> add </s> remove "errors"
</s> add </s> remove "errors"
</s> add </s> remove "errors"
</s> add </s> remove "errors"
</s> add | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/dnsforward/clientid.go |
keep keep keep add keep keep keep keep | <mask> "strings"
<mask>
<mask> "github.com/AdguardTeam/AdGuardHome/internal/aghnet"
<mask> "github.com/AdguardTeam/dnsproxy/proxy"
<mask> "github.com/lucas-clemente/quic-go"
<mask> )
<mask>
<mask> // ValidateClientID returns an error if clientID is not a valid client ID.
</s> 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 </s> remove errBadAddrPassed agherr.Error = "the passed string is not a valid IP address"
</s> add errBadAddrPassed errors.Error = "the passed string is not a valid IP address" </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add "github.com/AdguardTeam/golibs/errors" </s> remove errFakeDial agherr.Error = "this error signals the successful dialFunc work"
</s> add errFakeDial errors.Error = "this error signals the successful dialFunc work" </s> remove defer agherr.Annotate("validating label %q: %w", &err, label)
</s> add defer func() { err = errors.Annotate(err, "validating label %q: %w", label) }() </s> remove defer agherr.Annotate("validating hardware address %q: %w", &err, hwa)
</s> add defer func() { err = errors.Annotate(err, "validating hardware address %q: %w", hwa) }() </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/dnsforward/clientid.go |
keep keep keep keep replace keep keep keep keep keep | <mask>
<mask> import (
<mask> "crypto/tls"
<mask> "crypto/x509"
<mask> "errors"
<mask> "fmt"
<mask> "net"
<mask> "net/http"
<mask> "os"
<mask> "sort"
</s> 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 </s> remove "errors"
</s> add </s> remove "errors"
</s> add </s> remove "errors"
</s> add </s> remove "errors"
</s> add </s> remove "errors"
</s> add </s> remove "errors"
</s> add | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/dnsforward/config.go |
keep add keep keep keep keep | <mask> "github.com/AdguardTeam/dnsproxy/proxy"
<mask> "github.com/AdguardTeam/dnsproxy/upstream"
<mask> "github.com/AdguardTeam/golibs/log"
<mask> "github.com/ameshkov/dnscrypt/v2"
<mask> )
<mask>
</s> 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 </s> add "github.com/AdguardTeam/golibs/errors" </s> add "github.com/AdguardTeam/golibs/errors" </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add </s> add "github.com/AdguardTeam/golibs/errors" </s> add "github.com/AdguardTeam/golibs/errors" </s> add "github.com/AdguardTeam/golibs/errors" | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/dnsforward/config.go |
keep keep keep keep replace keep keep keep keep keep | <mask> }
<mask>
<mask> // Validate proxy config
<mask> if proxyConfig.UpstreamConfig == nil || len(proxyConfig.UpstreamConfig.Upstreams) == 0 {
<mask> return proxyConfig, errors.New("no default upstream servers configured")
<mask> }
<mask>
<mask> return proxyConfig, nil
<mask> }
<mask>
</s> 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 </s> remove return nil, errors.New("found no DNS servers in /etc/resolv.conf")
</s> add return nil, errors.Error("found no DNS servers in /etc/resolv.conf") </s> remove return set, agherr.Error("empty response or no family data")
</s> add return set, errors.Error("empty response or no family data") </s> remove defer agherr.Annotate("bad upstream for domain spec %q: %w", &err, upstreamStr)
</s> add defer func() { err = errors.Annotate(err, "bad upstream for domain spec %q: %w", upstreamStr) }() </s> remove return errors.New(data.WarningValidation)
</s> add return errors.Error(data.WarningValidation) </s> remove if len(errors) != 0 {
return agherr.Many("closing ipsets", errors...)
</s> add if len(errs) != 0 {
return errors.List("closing ipsets", errs...) </s> remove return agherr.Error("domain name is empty")
</s> add return errors.Error("domain name is empty") | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/dnsforward/config.go |
keep keep keep keep replace keep keep keep keep keep | <mask> // Package dnsforward contains a DNS forwarding server.
<mask> package dnsforward
<mask>
<mask> import (
<mask> "errors"
<mask> "fmt"
<mask> "net"
<mask> "net/http"
<mask> "os"
<mask> "runtime"
</s> 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 </s> remove "errors"
</s> add </s> remove "errors"
</s> add </s> remove "errors"
</s> add </s> remove "errors"
</s> add </s> remove "errors"
</s> add </s> remove "errors"
</s> add | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/dnsforward/dnsforward.go |
keep keep keep keep replace keep keep keep keep keep | <mask> "strings"
<mask> "sync"
<mask> "time"
<mask>
<mask> "github.com/AdguardTeam/AdGuardHome/internal/agherr"
<mask> "github.com/AdguardTeam/AdGuardHome/internal/aghnet"
<mask> "github.com/AdguardTeam/AdGuardHome/internal/aghstrings"
<mask> "github.com/AdguardTeam/AdGuardHome/internal/dhcpd"
<mask> "github.com/AdguardTeam/AdGuardHome/internal/filtering"
<mask> "github.com/AdguardTeam/AdGuardHome/internal/querylog"
</s> 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 </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/dnsforward/dnsforward.go |
keep keep add keep keep keep keep keep keep | <mask> "github.com/AdguardTeam/AdGuardHome/internal/stats"
<mask> "github.com/AdguardTeam/dnsproxy/proxy"
<mask> "github.com/AdguardTeam/dnsproxy/upstream"
<mask> "github.com/AdguardTeam/golibs/log"
<mask> "github.com/miekg/dns"
<mask> )
<mask>
<mask> // DefaultTimeout is the default upstream timeout
<mask> const DefaultTimeout = 10 * time.Second
</s> 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 </s> add "github.com/AdguardTeam/golibs/errors" </s> remove defer agherr.LogPanic("")
</s> add defer log.OnPanic("") </s> add "github.com/AdguardTeam/golibs/errors" </s> add "github.com/AdguardTeam/golibs/errors" </s> add "github.com/AdguardTeam/golibs/errors" </s> add "github.com/AdguardTeam/golibs/errors" | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/dnsforward/dnsforward.go |
keep replace keep keep keep replace keep keep keep | <mask> // section of respond is empty.
<mask> rDNSEmptyAnswerErr agherr.Error = "the answer section is empty"
<mask>
<mask> // rDNSNotPTRErr is returned by Exchange method when the response is not
<mask> // of PTR type.
<mask> rDNSNotPTRErr agherr.Error = "the response is not a ptr"
<mask> )
<mask>
<mask> // Exchange implements the RDNSExchanger interface for *Server.
</s> 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 </s> remove errBadAddrPassed agherr.Error = "the passed string is not a valid IP address"
</s> add errBadAddrPassed errors.Error = "the passed string is not a valid IP address" </s> remove errFakeDial agherr.Error = "this error signals the successful dialFunc work"
</s> add errFakeDial errors.Error = "this error signals the successful dialFunc work" </s> remove const ErrNoStaticIPInfo agherr.Error = "no information about static ip"
</s> add const ErrNoStaticIPInfo errors.Error = "no information about static ip" </s> remove errUnexpectedHostFormat agherr.Error = "unexpected host format"
</s> add errUnexpectedHostFormat errors.Error = "unexpected host format" </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/dnsforward/dnsforward.go |
keep keep keep keep replace keep keep keep keep keep | <mask> "sync"
<mask> "testing"
<mask> "time"
<mask>
<mask> "github.com/AdguardTeam/AdGuardHome/internal/agherr"
<mask> "github.com/AdguardTeam/AdGuardHome/internal/aghnet"
<mask> "github.com/AdguardTeam/AdGuardHome/internal/aghtest"
<mask> "github.com/AdguardTeam/AdGuardHome/internal/dhcpd"
<mask> "github.com/AdguardTeam/AdGuardHome/internal/filtering"
<mask> "github.com/AdguardTeam/dnsproxy/proxy"
</s> 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 </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add </s> add "github.com/AdguardTeam/golibs/errors" | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/dnsforward/dnsforward_test.go |
keep keep keep add keep keep keep keep keep keep | <mask> "github.com/AdguardTeam/AdGuardHome/internal/dhcpd"
<mask> "github.com/AdguardTeam/AdGuardHome/internal/filtering"
<mask> "github.com/AdguardTeam/dnsproxy/proxy"
<mask> "github.com/AdguardTeam/dnsproxy/upstream"
<mask> "github.com/miekg/dns"
<mask> "github.com/stretchr/testify/assert"
<mask> "github.com/stretchr/testify/require"
<mask> )
<mask>
<mask> func TestMain(m *testing.M) {
</s> 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 </s> add "github.com/AdguardTeam/golibs/errors" </s> add "github.com/AdguardTeam/golibs/errors" </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add "github.com/AdguardTeam/golibs/errors" </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add </s> add "github.com/AdguardTeam/golibs/errors" </s> add "github.com/AdguardTeam/golibs/errors" | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/dnsforward/dnsforward_test.go |
keep keep keep keep replace keep keep keep keep keep | <mask> "1.1.168.192.in-addr.arpa.": {"local.domain"},
<mask> "2.1.168.192.in-addr.arpa.": {},
<mask> },
<mask> }
<mask> upstreamErr := agherr.Error("upstream error")
<mask> errUpstream := &aghtest.TestErrUpstream{
<mask> Err: upstreamErr,
<mask> }
<mask> nonPtrUpstream := &aghtest.TestBlockUpstream{
<mask> Hostname: "some-host",
</s> 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 </s> remove Err: errors.New("1234"),
</s> add Err: errors.Error("1234"), </s> remove return agherr.Error("domain name is empty")
</s> add return errors.Error("domain name is empty") </s> remove connReadCloser, err := aghio.LimitReadCloser(conn, MaxConnReadSize)
</s> add r, err := aghio.LimitReader(conn, MaxConnReadSize) </s> remove err := e.Encode(entry)
</s> add err = e.Encode(entry) </s> remove return agherr.Error("no dns rewrite rule responses")
</s> add return errors.Error("no dns rewrite rule responses") </s> remove _, inputNameOnly := filepath.Split(header.Name)
if inputNameOnly == "" {
continue
</s> add break | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/dnsforward/dnsforward_test.go |
keep keep keep keep replace keep keep keep keep keep | <mask> import (
<mask> "fmt"
<mask> "net"
<mask>
<mask> "github.com/AdguardTeam/AdGuardHome/internal/agherr"
<mask> "github.com/AdguardTeam/AdGuardHome/internal/filtering"
<mask> "github.com/AdguardTeam/dnsproxy/proxy"
<mask> "github.com/AdguardTeam/golibs/log"
<mask> "github.com/AdguardTeam/urlfilter/rules"
<mask> "github.com/miekg/dns"
</s> 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 </s> add "github.com/AdguardTeam/golibs/errors" </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add </s> add "github.com/AdguardTeam/golibs/errors" </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add "github.com/AdguardTeam/golibs/errors" </s> add "github.com/AdguardTeam/golibs/errors" </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/dnsforward/dnsrewrite.go |
keep add keep keep keep keep keep keep | <mask> "github.com/AdguardTeam/AdGuardHome/internal/filtering"
<mask> "github.com/AdguardTeam/dnsproxy/proxy"
<mask> "github.com/AdguardTeam/golibs/log"
<mask> "github.com/AdguardTeam/urlfilter/rules"
<mask> "github.com/miekg/dns"
<mask> )
<mask>
<mask> // filterDNSRewriteResponse handles a single DNS rewrite response entry.
</s> 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 </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add </s> add "github.com/AdguardTeam/golibs/errors" </s> add "github.com/AdguardTeam/golibs/errors" </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add </s> add "github.com/AdguardTeam/golibs/errors" </s> add "github.com/AdguardTeam/golibs/errors" | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/dnsforward/dnsrewrite.go |
keep keep keep keep replace keep keep keep keep keep | <mask> func (s *Server) filterDNSRewrite(req *dns.Msg, res filtering.Result, d *proxy.DNSContext) (err error) {
<mask> resp := s.makeResponse(req)
<mask> dnsrr := res.DNSRewriteResult
<mask> if dnsrr == nil {
<mask> return agherr.Error("no dns rewrite rule content")
<mask> }
<mask>
<mask> resp.Rcode = dnsrr.RCode
<mask> if resp.Rcode != dns.RcodeSuccess {
<mask> d.Res = resp
</s> 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 </s> remove return agherr.Error("no dns rewrite rule responses")
</s> add return errors.Error("no dns rewrite rule responses") </s> remove defer f.Close()
</s> add </s> remove func (u *Updater) downloadPackageFile(url, filename string) error {
resp, err := u.client.Get(url)
</s> add func (u *Updater) downloadPackageFile(url, filename string) (err error) {
var resp *http.Response
resp, err = u.client.Get(url) </s> add var resp *http.Response </s> remove defer agherr.Annotate("dhcpv4: %w", &err)
</s> add defer func() { err = errors.Annotate(err, "dhcpv4: %w") }() </s> remove defer agherr.Annotate("dhcpv6: %w", &err)
</s> add defer func() { err = errors.Annotate(err, "dhcpv6: %w") }() | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/dnsforward/dnsrewrite.go |
keep keep keep keep replace keep keep keep keep keep | <mask> return nil
<mask> }
<mask>
<mask> if dnsrr.Response == nil {
<mask> return agherr.Error("no dns rewrite rule responses")
<mask> }
<mask>
<mask> rr := req.Question[0].Qtype
<mask> values := dnsrr.Response[rr]
<mask> for i, v := range values {
</s> 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 </s> remove return agherr.Error("no dns rewrite rule content")
</s> add return errors.Error("no dns rewrite rule content") </s> remove return "", false, agherr.Error("duplicated separator")
</s> add return "", false, errors.Error("duplicated separator") </s> remove return agherr.Error("id required")
</s> add return errors.Error("id required") </s> remove return errors.New(data.WarningValidation)
</s> add return errors.Error(data.WarningValidation) </s> remove err := e.Encode(entry)
</s> add err = e.Encode(entry) </s> remove return nil, errors.New("couldn't find any legible interface")
</s> add return nil, errors.Error("couldn't find any legible interface") | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/dnsforward/dnsrewrite.go |
keep keep keep keep replace keep keep keep keep keep | <mask> "net/http"
<mask> "strconv"
<mask> "strings"
<mask>
<mask> "github.com/AdguardTeam/AdGuardHome/internal/agherr"
<mask> "github.com/AdguardTeam/AdGuardHome/internal/aghnet"
<mask> "github.com/AdguardTeam/AdGuardHome/internal/aghstrings"
<mask> "github.com/AdguardTeam/dnsproxy/proxy"
<mask> "github.com/AdguardTeam/dnsproxy/upstream"
<mask> "github.com/AdguardTeam/golibs/log"
</s> 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 </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add </s> add "github.com/AdguardTeam/golibs/errors" | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/dnsforward/http.go |
keep add keep keep keep keep keep keep | <mask> "github.com/AdguardTeam/dnsproxy/proxy"
<mask> "github.com/AdguardTeam/dnsproxy/upstream"
<mask> "github.com/AdguardTeam/golibs/log"
<mask> "github.com/miekg/dns"
<mask> )
<mask>
<mask> func httpError(r *http.Request, w http.ResponseWriter, code int, format string, args ...interface{}) {
<mask> text := fmt.Sprintf(format, args...)
</s> 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 </s> add "github.com/AdguardTeam/golibs/errors" </s> add "github.com/AdguardTeam/golibs/errors" </s> add "github.com/AdguardTeam/golibs/errors" </s> add "github.com/AdguardTeam/golibs/errors" </s> add "github.com/AdguardTeam/golibs/errors" </s> add "github.com/AdguardTeam/golibs/errors" | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/dnsforward/http.go |
keep keep keep keep replace keep keep keep keep keep | <mask>
<mask> // separateUpstream returns the upstream without the specified domains.
<mask> // useDefault is true when a default upstream must be used.
<mask> func separateUpstream(upstreamStr string) (upstream string, useDefault bool, err error) {
<mask> defer agherr.Annotate("bad upstream for domain spec %q: %w", &err, upstreamStr)
<mask>
<mask> if !strings.HasPrefix(upstreamStr, "[/") {
<mask> return upstreamStr, true, nil
<mask> }
<mask>
</s> 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 </s> remove return proxyConfig, errors.New("no default upstream servers configured")
</s> add return proxyConfig, errors.Error("no default upstream servers configured") </s> remove defer agherr.Annotate("normalizing %q: %w", &err, hostname)
</s> add defer func() { err = errors.Annotate(err, "normalizing %q: %w", hostname) }() </s> remove defer agherr.Annotate("validating label %q: %w", &err, label)
</s> add defer func() { err = errors.Annotate(err, "validating label %q: %w", label) }() </s> add "github.com/AdguardTeam/golibs/errors" </s> remove defer agherr.Annotate("validating domain name %q: %w", &err, name)
</s> add defer func() { err = errors.Annotate(err, "validating domain name %q: %w", name) }() </s> remove defer agherr.Annotate("parsing %q: %w", &err, host)
</s> add defer func() { err = errors.Annotate(err, "parsing %q: %w", host) }() | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/dnsforward/http.go |
keep keep keep keep replace keep keep keep keep keep | <mask> }
<mask>
<mask> parts := strings.Split(upstreamStr[2:], "/]")
<mask> if len(parts) != 2 {
<mask> return "", false, agherr.Error("duplicated separator")
<mask> }
<mask>
<mask> domains := parts[0]
<mask> upstream = parts[1]
<mask> for i, host := range strings.Split(domains, "/") {
</s> 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 </s> remove return 0, nil, agherr.Error("need at least three fields")
</s> add return 0, nil, errors.Error("need at least three fields") </s> remove return agherr.Error("no dns rewrite rule responses")
</s> add return errors.Error("no dns rewrite rule responses") </s> remove defer agherr.Annotate("parsing %q: %w", &err, host)
</s> add defer func() { err = errors.Annotate(err, "parsing %q: %w", host) }() </s> remove return agherr.Error("id required")
</s> add return errors.Error("id required") </s> remove err := e.Encode(entry)
</s> add err = e.Encode(entry) </s> remove return errors.New(data.WarningValidation)
</s> add return errors.Error(data.WarningValidation) | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/dnsforward/http.go |
keep keep keep keep replace keep keep keep keep keep | <mask> "net"
<mask> "strings"
<mask> "sync"
<mask>
<mask> "github.com/AdguardTeam/AdGuardHome/internal/agherr"
<mask> "github.com/AdguardTeam/golibs/log"
<mask> "github.com/digineo/go-ipset/v2"
<mask> "github.com/mdlayher/netlink"
<mask> "github.com/miekg/dns"
<mask> "github.com/ti-mo/netfilter"
</s> 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 </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add "github.com/AdguardTeam/golibs/errors" </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/dnsforward/ipset_linux.go |
keep keep keep keep replace keep keep keep keep keep | <mask> return set, err
<mask> }
<mask>
<mask> if res == nil || res.Family == nil {
<mask> return set, agherr.Error("empty response or no family data")
<mask> }
<mask>
<mask> family := netfilter.ProtoFamily(res.Family.Value)
<mask> if family != netfilter.ProtoIPv4 && family != netfilter.ProtoIPv6 {
<mask> return set, fmt.Errorf("unexpected ipset family %s", family)
</s> 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 </s> remove return proxyConfig, errors.New("no default upstream servers configured")
</s> add return proxyConfig, errors.Error("no default upstream servers configured") </s> remove return errors.New(data.WarningValidation)
</s> add return errors.Error(data.WarningValidation) </s> remove }
</s> add } else if err != nil {
err = fmt.Errorf("tarReader.Next(): %w", err) </s> remove defer f.Close()
fileReadCloser, err := aghio.LimitReadCloser(f, MaxFileSize)
</s> add defer func() {
derr := f.Close()
if derr != nil {
log.Error("glinet: closing file: %s", err)
}
}()
fileReader, err := aghio.LimitReader(f, MaxFileSize) </s> remove return agherr.Error("no dns rewrite rule content")
</s> add return errors.Error("no dns rewrite rule content") </s> remove if header.Typeflag == tar.TypeDir {
if inputNameOnly == "AdGuardHome" {
// Top-level AdGuardHome/. Skip it.
//
// TODO(a.garipov): This whole package needs to
// be rewritten and covered in more integration
// tests. It has weird assumptions and file
// mode issues.
continue
}
</s> add if name != "" {
files = append(files, name)
}
} | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/dnsforward/ipset_linux.go |
keep keep keep keep replace keep keep keep replace keep | <mask> }
<mask>
<mask> // Close closes the Linux Netfilter connections.
<mask> func (c *ipsetCtx) Close() (err error) {
<mask> var errors []error
<mask> if c.ipv4Conn != nil {
<mask> err = c.ipv4Conn.Close()
<mask> if err != nil {
<mask> errors = append(errors, err)
<mask> }
</s> 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 </s> remove errors = append(errors, err)
</s> add errs = append(errs, err) </s> remove if len(errors) != 0 {
return agherr.Many("closing ipsets", errors...)
</s> add if len(errs) != 0 {
return errors.List("closing ipsets", errs...) </s> remove defer agherr.Annotate("systemResolvers: %w", &err)
</s> add defer func() { err = errors.Annotate(err, "systemResolvers: %w") }() </s> remove defer agherr.Annotate("dhcpv6: %w", &err)
</s> add defer func() { err = errors.Annotate(err, "dhcpv6: %w") }() </s> remove defer agherr.Annotate("dhcpv4: %w", &err)
</s> add defer func() { err = errors.Annotate(err, "dhcpv4: %w") }() | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/dnsforward/ipset_linux.go |
keep keep keep replace keep keep keep replace replace keep keep keep keep | <mask> if c.ipv6Conn != nil {
<mask> err = c.ipv6Conn.Close()
<mask> if err != nil {
<mask> errors = append(errors, err)
<mask> }
<mask> }
<mask>
<mask> if len(errors) != 0 {
<mask> return agherr.Many("closing ipsets", errors...)
<mask> }
<mask>
<mask> return nil
<mask> }
</s> 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 </s> remove errors = append(errors, err)
</s> add errs = append(errs, err) </s> remove var errors []error
</s> add var errs []error </s> remove defer f.Close()
fileReadCloser, err := aghio.LimitReadCloser(f, MaxFileSize)
</s> add defer func() {
derr := f.Close()
if derr != nil {
log.Error("glinet: closing file: %s", err)
}
}()
fileReader, err := aghio.LimitReader(f, MaxFileSize) </s> remove }
</s> add } else if err != nil {
err = fmt.Errorf("tarReader.Next(): %w", err) </s> remove defer r.Close()
</s> add defer func() {
derr := r.Close()
if derr != nil {
log.Error("querylog: closing file: %s", err)
}
}() | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/dnsforward/ipset_linux.go |
keep keep keep keep replace replace replace keep keep keep keep keep | <mask> if err != nil {
<mask> log.Error("os.Open: %s", err)
<mask> return 0
<mask> }
<mask> defer f.Close()
<mask>
<mask> fileReadCloser, err := aghio.LimitReadCloser(f, MaxFileSize)
<mask> if err != nil {
<mask> log.Error("creating limited reader: %s", err)
<mask>
<mask> return 0
<mask> }
</s> 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 </s> remove defer fileReadCloser.Close()
</s> add </s> remove defer r.Close()
</s> add defer func() {
derr := r.Close()
if derr != nil {
log.Error("querylog: closing file: %s", err)
}
}() </s> remove defer f.Close()
</s> add defer func() {
derr := f.Close()
if derr != nil {
log.Error("etchostscontainer: closing file: %s", err)
}
}()
</s> remove bs, err := io.ReadAll(fileReadCloser)
</s> add bs, err := io.ReadAll(fileReader) </s> remove defer f.Close()
</s> add defer func() { err = errors.WithDeferred(err, f.Close()) }() </s> remove defer f.Close()
</s> add defer func() { err = errors.WithDeferred(err, f.Close()) }() | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/home/authglinet.go |
keep keep keep keep replace keep keep keep keep keep | <mask> log.Error("creating limited reader: %s", err)
<mask>
<mask> return 0
<mask> }
<mask> defer fileReadCloser.Close()
<mask>
<mask> var dateToken uint32
<mask>
<mask> // This use of ReadAll is now safe, because we limited reader.
<mask> bs, err := io.ReadAll(fileReadCloser)
</s> 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 </s> remove bs, err := io.ReadAll(fileReadCloser)
</s> add bs, err := io.ReadAll(fileReader) </s> remove data, err := io.ReadAll(connReadCloser)
</s> add var whoisData []byte
whoisData, err = io.ReadAll(r) </s> remove body, err := io.ReadAll(resp.Body)
</s> add body, err := io.ReadAll(r) </s> remove defer resp.Body.Close()
</s> add </s> remove body, err := io.ReadAll(resp.Body)
</s> add body, err := io.ReadAll(r) </s> remove defer resp.Body.Close()
</s> add | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/home/authglinet.go |
keep keep keep keep replace keep keep keep keep keep | <mask>
<mask> var dateToken uint32
<mask>
<mask> // This use of ReadAll is now safe, because we limited reader.
<mask> bs, err := io.ReadAll(fileReadCloser)
<mask> if err != nil {
<mask> log.Error("reading token: %s", err)
<mask>
<mask> return 0
<mask> }
</s> 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 </s> remove defer fileReadCloser.Close()
</s> add </s> remove data, err := io.ReadAll(connReadCloser)
</s> add var whoisData []byte
whoisData, err = io.ReadAll(r) </s> remove body, err := io.ReadAll(resp.Body)
</s> add body, err := io.ReadAll(r) </s> remove defer resp.Body.Close()
</s> add </s> remove defer resp.Body.Close()
</s> add </s> remove body, err := io.ReadAll(resp.Body)
</s> add body, err := io.ReadAll(r) | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/home/authglinet.go |
keep keep keep keep replace keep keep keep keep keep | <mask> "strings"
<mask> "sync"
<mask> "time"
<mask>
<mask> "github.com/AdguardTeam/AdGuardHome/internal/agherr"
<mask> "github.com/AdguardTeam/AdGuardHome/internal/aghnet"
<mask> "github.com/AdguardTeam/AdGuardHome/internal/aghstrings"
<mask> "github.com/AdguardTeam/AdGuardHome/internal/dhcpd"
<mask> "github.com/AdguardTeam/AdGuardHome/internal/dnsforward"
<mask> "github.com/AdguardTeam/AdGuardHome/internal/filtering"
</s> 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 </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/home/clients.go |
keep add keep keep keep keep keep | <mask> "github.com/AdguardTeam/dnsproxy/proxy"
<mask> "github.com/AdguardTeam/dnsproxy/upstream"
<mask> "github.com/AdguardTeam/golibs/log"
<mask> )
<mask>
<mask> const clientsUpdatePeriod = 10 * time.Minute
<mask>
</s> 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 </s> add "github.com/AdguardTeam/golibs/errors" </s> add "github.com/AdguardTeam/golibs/errors" </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add </s> add "github.com/AdguardTeam/golibs/errors" </s> add "github.com/AdguardTeam/golibs/errors" </s> add "github.com/AdguardTeam/golibs/errors" | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/home/clients.go |
keep keep replace keep replace | <mask> switch {
<mask> case c == nil:
<mask> return agherr.Error("client is nil")
<mask> case c.Name == "":
<mask> return agherr.Error("invalid name")
</s> 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 </s> remove return agherr.Error("id required")
</s> add return errors.Error("id required") </s> remove return agherr.Error("question is nil")
</s> add return errors.Error("question is nil") </s> remove return agherr.Error("more than one question")
</s> add return errors.Error("more than one question") </s> remove return agherr.Error("no host in question")
</s> add return errors.Error("no host in question") </s> remove return agherr.Error("no client ip")
</s> add return errors.Error("no client ip") | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/home/clients.go |
keep keep keep keep replace keep keep keep keep keep | <mask> return agherr.Error("client is nil")
<mask> case c.Name == "":
<mask> return agherr.Error("invalid name")
<mask> case len(c.IDs) == 0:
<mask> return agherr.Error("id required")
<mask> default:
<mask> // Go on.
<mask> }
<mask>
<mask> for i, id := range c.IDs {
</s> 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 </s> remove return agherr.Error("invalid name")
</s> add return errors.Error("invalid name") </s> remove return agherr.Error("client is nil")
</s> add return errors.Error("client is nil") </s> remove return agherr.Error("more than one question")
</s> add return errors.Error("more than one question") </s> remove return agherr.Error("no host in question")
</s> add return errors.Error("no host in question") </s> remove return agherr.Error("question is nil")
</s> add return errors.Error("question is nil") </s> remove return agherr.Error("no client ip")
</s> add return errors.Error("no client ip") | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/home/clients.go |
keep keep keep keep replace keep keep keep keep keep | <mask> defer clients.lock.Unlock()
<mask>
<mask> prev, ok := clients.list[name]
<mask> if !ok {
<mask> return agherr.Error("client not found")
<mask> }
<mask>
<mask> // First, check the name index.
<mask> if prev.Name != c.Name {
<mask> _, ok = clients.list[c.Name]
</s> 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 </s> remove return agherr.Error("client already exists")
</s> add return errors.Error("client already exists") </s> remove return agherr.Error("client is nil")
</s> add return errors.Error("client is nil") </s> remove return agherr.Error("lease not found")
</s> add return errors.Error("lease not found") </s> remove return agherr.Error("id required")
</s> add return errors.Error("id required") </s> remove var files []string
var err2 error
var zr io.ReadCloser
for _, zf := range r.File {
zr, err = zf.Open()
</s> add for _, zf := range zrc.File {
var name string
name, err = zipFileUnpackOne(outDir, zf) </s> remove return agherr.Error("invalid name")
</s> add return errors.Error("invalid name") | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/home/clients.go |
keep keep keep keep replace keep keep keep keep keep | <mask> // First, check the name index.
<mask> if prev.Name != c.Name {
<mask> _, ok = clients.list[c.Name]
<mask> if ok {
<mask> return agherr.Error("client already exists")
<mask> }
<mask> }
<mask>
<mask> // Second, check the IP index.
<mask> if !equalStringSlices(prev.IDs, c.IDs) {
</s> 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 </s> remove return agherr.Error("client not found")
</s> add return errors.Error("client not found") </s> remove return agherr.Error("static lease already exists")
</s> add return errors.Error("static lease already exists") </s> remove return agherr.Error("client is nil")
</s> add return errors.Error("client is nil") </s> remove return agherr.Error("static lease already exists")
</s> add return errors.Error("static lease already exists") </s> remove return errors.New("IP address is already static")
</s> add return errors.Error("IP address is already static") </s> remove return errors.New(data.WarningValidation)
</s> add return errors.Error(data.WarningValidation) | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/home/clients.go |
keep keep keep replace keep keep keep keep keep | <mask> package home
<mask>
<mask> import (
<mask> "errors"
<mask> "fmt"
<mask> "net"
<mask> "os"
<mask> "path/filepath"
<mask> "sync"
</s> 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 </s> remove "errors"
</s> add </s> remove "errors"
</s> add </s> remove "errors"
</s> add </s> remove "errors"
</s> add </s> remove "errors"
</s> add </s> remove "errors"
</s> add | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/home/config.go |
keep keep keep add keep keep keep keep | <mask> "github.com/AdguardTeam/AdGuardHome/internal/filtering"
<mask> "github.com/AdguardTeam/AdGuardHome/internal/querylog"
<mask> "github.com/AdguardTeam/AdGuardHome/internal/stats"
<mask> "github.com/AdguardTeam/AdGuardHome/internal/version"
<mask> "github.com/AdguardTeam/golibs/log"
<mask> "github.com/google/renameio/maybe"
<mask> yaml "gopkg.in/yaml.v2"
<mask> )
</s> 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 </s> add "github.com/AdguardTeam/golibs/errors" </s> add "github.com/AdguardTeam/golibs/errors" </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add </s> add "github.com/AdguardTeam/golibs/errors" </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add </s> add "github.com/AdguardTeam/golibs/errors" | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/home/config.go |
keep keep keep keep replace keep keep keep keep keep | <mask> "strconv"
<mask> "strings"
<mask> "time"
<mask>
<mask> "github.com/AdguardTeam/AdGuardHome/internal/agherr"
<mask> "github.com/AdguardTeam/AdGuardHome/internal/aghnet"
<mask> "github.com/AdguardTeam/golibs/log"
<mask> )
<mask>
<mask> // getAddrsResponse is the response for /install/get_addresses endpoint.
</s> 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 </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add "github.com/AdguardTeam/golibs/errors" </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/home/controlinstall.go |
keep keep keep keep replace keep keep keep keep keep | <mask> // shutdownTimeout is the timeout for shutting HTTP server down operation.
<mask> const shutdownTimeout = 5 * time.Second
<mask>
<mask> func shutdownSrv(ctx context.Context, cancel context.CancelFunc, srv *http.Server) {
<mask> defer agherr.LogPanic("")
<mask>
<mask> if srv == nil {
<mask> return
<mask> }
<mask>
</s> 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 </s> add "github.com/AdguardTeam/golibs/errors" </s> remove func (w *Whois) query(ctx context.Context, target, serverAddr string) (string, error) {
</s> add func (w *Whois) query(ctx context.Context, target, serverAddr string) (data string, err error) { </s> remove return string(data), nil
</s> add return string(whoisData), nil </s> remove func (u *Updater) downloadPackageFile(url, filename string) error {
resp, err := u.client.Get(url)
</s> add func (u *Updater) downloadPackageFile(url, filename string) (err error) {
var resp *http.Response
resp, err = u.client.Get(url) </s> remove func (u *Updater) VersionInfo(forceRecheck bool) (VersionInfo, error) {
</s> add func (u *Updater) VersionInfo(forceRecheck bool) (vi VersionInfo, err error) { </s> remove defer agherr.Annotate("dhcpv4: adding static lease: %w", &err)
</s> add defer func() { err = errors.Annotate(err, "dhcpv4: adding static lease: %w") }() | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/home/controlinstall.go |
keep keep keep keep replace keep keep keep keep keep | <mask>
<mask> import (
<mask> "context"
<mask> "encoding/json"
<mask> "errors"
<mask> "net/http"
<mask> "os"
<mask> "os/exec"
<mask> "path/filepath"
<mask> "runtime"
</s> 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 </s> remove "errors"
</s> add </s> remove "errors"
</s> add </s> remove "errors"
</s> add </s> remove "errors"
</s> add </s> remove "errors"
</s> add </s> remove "errors"
</s> add | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/home/controlupdate.go |
keep add keep keep keep keep | <mask> "github.com/AdguardTeam/AdGuardHome/internal/aghos"
<mask> "github.com/AdguardTeam/AdGuardHome/internal/updater"
<mask> "github.com/AdguardTeam/golibs/log"
<mask> )
<mask>
<mask> // temporaryError is the interface for temporary errors from the Go standard
</s> 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 </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add </s> add "github.com/AdguardTeam/golibs/errors" </s> add "github.com/AdguardTeam/golibs/errors" </s> add "github.com/AdguardTeam/golibs/errors" </s> remove rDNSNotPTRErr agherr.Error = "the response is not a ptr"
</s> add rDNSNotPTRErr errors.Error = "the response is not a ptr" </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add "github.com/AdguardTeam/golibs/errors" | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/home/controlupdate.go |
keep keep keep keep replace keep keep keep keep keep | <mask> "os"
<mask> "path/filepath"
<mask> "strconv"
<mask>
<mask> "github.com/AdguardTeam/AdGuardHome/internal/agherr"
<mask> "github.com/AdguardTeam/AdGuardHome/internal/dnsforward"
<mask> "github.com/AdguardTeam/AdGuardHome/internal/filtering"
<mask> "github.com/AdguardTeam/AdGuardHome/internal/querylog"
<mask> "github.com/AdguardTeam/AdGuardHome/internal/stats"
<mask> "github.com/AdguardTeam/dnsproxy/proxy"
</s> 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 </s> add "github.com/AdguardTeam/golibs/errors" </s> add "github.com/AdguardTeam/golibs/errors" </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/home/dns.go |
keep keep add keep keep keep keep keep keep | <mask> "github.com/AdguardTeam/AdGuardHome/internal/querylog"
<mask> "github.com/AdguardTeam/AdGuardHome/internal/stats"
<mask> "github.com/AdguardTeam/dnsproxy/proxy"
<mask> "github.com/AdguardTeam/golibs/log"
<mask> "github.com/ameshkov/dnscrypt/v2"
<mask> yaml "gopkg.in/yaml.v2"
<mask> )
<mask>
<mask> // Called by other modules when configuration is changed
</s> 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 </s> add "github.com/AdguardTeam/golibs/errors" </s> add "github.com/AdguardTeam/golibs/errors" </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add </s> add "github.com/AdguardTeam/golibs/errors" </s> add "github.com/AdguardTeam/golibs/errors" </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/home/dns.go |
keep keep keep keep replace keep keep keep keep keep | <mask> }
<mask>
<mask> func newDNSCrypt(hosts []net.IP, tlsConf tlsConfigSettings) (dnscc dnsforward.DNSCryptConfig, err error) {
<mask> if tlsConf.DNSCryptConfigFile == "" {
<mask> return dnscc, agherr.Error("no dnscrypt_config_file")
<mask> }
<mask>
<mask> f, err := os.Open(tlsConf.DNSCryptConfigFile)
<mask> if err != nil {
<mask> return dnscc, fmt.Errorf("opening dnscrypt config: %w", err)
</s> 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 </s> remove defer f.Close()
</s> add defer func() { err = errors.WithDeferred(err, f.Close()) }() </s> remove }
</s> add } else if err != nil {
err = fmt.Errorf("tarReader.Next(): %w", err) </s> remove defer file.Close()
</s> add defer func() { err = errors.WithDeferred(err, file.Close()) }() </s> remove fi := zf.FileInfo()
inputNameOnly := fi.Name()
if inputNameOnly == "" {
continue
}
outputName := filepath.Join(outdir, inputNameOnly)
if fi.IsDir() {
if inputNameOnly == "AdGuardHome" {
// Top-level AdGuardHome/. Skip it.
//
// TODO(a.garipov): See the similar todo in
// tarGzFileUnpack.
continue
}
err = os.Mkdir(outputName, fi.Mode())
if err != nil && !errors.Is(err, os.ErrExist) {
err2 = fmt.Errorf("os.Mkdir(%q): %w", outputName, err)
break
}
log.Tracef("created directory %q", outputName)
continue
}
var f io.WriteCloser
f, err = os.OpenFile(outputName, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, fi.Mode())
if err != nil {
err2 = fmt.Errorf("os.OpenFile(): %w", err)
break
}
_, err = io.Copy(f, zr)
if err != nil {
_ = f.Close()
err2 = fmt.Errorf("io.Copy(): %w", err)
break
</s> add if name != "" {
files = append(files, name) </s> remove defer func() {
_ = f.Close()
}()
</s> add defer func() { err = errors.WithDeferred(err, f.Close()) }() </s> remove _, inputNameOnly := filepath.Split(header.Name)
if inputNameOnly == "" {
continue
</s> add break | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/home/dns.go |
keep keep keep keep replace keep keep keep keep keep | <mask> f, err := os.Open(tlsConf.DNSCryptConfigFile)
<mask> if err != nil {
<mask> return dnscc, fmt.Errorf("opening dnscrypt config: %w", err)
<mask> }
<mask> defer f.Close()
<mask>
<mask> rc := &dnscrypt.ResolverConfig{}
<mask> err = yaml.NewDecoder(f).Decode(rc)
<mask> if err != nil {
<mask> return dnscc, fmt.Errorf("decoding dnscrypt config: %w", err)
</s> 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 </s> remove return dnscc, agherr.Error("no dnscrypt_config_file")
</s> add return dnscc, errors.Error("no dnscrypt_config_file") </s> remove defer func() {
_ = f.Close()
}()
</s> add defer func() { err = errors.WithDeferred(err, f.Close()) }() </s> remove defer file.Close()
</s> add defer func() { err = errors.WithDeferred(err, file.Close()) }() </s> remove defer f.Close()
</s> add defer func() {
derr := f.Close()
if derr != nil {
log.Error("querylog: closing file: %s", derr)
}
}() </s> remove var f io.WriteCloser
f, err = os.OpenFile(outputName, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, os.FileMode(header.Mode&0o777))
if err != nil {
err2 = fmt.Errorf("os.OpenFile(%s): %w", outputName, err)
break
}
_, err = io.Copy(f, tarReader)
if err != nil {
_ = f.Close()
err2 = fmt.Errorf("io.Copy(): %w", err)
break
}
err = f.Close()
if err != nil {
err2 = fmt.Errorf("f.Close(): %w", err)
break
</s> add err = os.Mkdir(outputName, fi.Mode())
if err != nil && !errors.Is(err, os.ErrExist) {
return "", fmt.Errorf("os.Mkdir(%q): %w", outputName, err) </s> remove defer f.Close()
fileReadCloser, err := aghio.LimitReadCloser(f, MaxFileSize)
</s> add defer func() {
derr := f.Close()
if derr != nil {
log.Error("glinet: closing file: %s", err)
}
}()
fileReader, err := aghio.LimitReader(f, MaxFileSize) | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/home/dns.go |
keep keep keep keep replace keep keep keep keep keep | <mask> package home
<mask>
<mask> import (
<mask> "bufio"
<mask> "errors"
<mask> "fmt"
<mask> "hash/crc32"
<mask> "io"
<mask> "net/http"
<mask> "os"
</s> 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 </s> remove "errors"
</s> add </s> remove "errors"
</s> add </s> remove "errors"
</s> add </s> remove "errors"
</s> add </s> remove "errors"
</s> add </s> remove "errors"
</s> add | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/home/filter.go |
keep keep add keep keep keep keep keep keep | <mask> "time"
<mask>
<mask> "github.com/AdguardTeam/AdGuardHome/internal/filtering"
<mask> "github.com/AdguardTeam/golibs/log"
<mask> )
<mask>
<mask> var nextFilterID = time.Now().Unix() // semi-stable way to generate an unique ID
<mask>
<mask> // Filtering - module object
</s> 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 </s> add "github.com/AdguardTeam/golibs/errors" </s> add "github.com/AdguardTeam/golibs/errors" </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add </s> add "github.com/AdguardTeam/golibs/errors" </s> add "github.com/AdguardTeam/golibs/errors" </s> add "github.com/AdguardTeam/golibs/errors" | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/home/filter.go |
keep keep keep add keep keep keep keep keep | <mask> f, err = os.Open(filter.URL)
<mask> if err != nil {
<mask> return updated, fmt.Errorf("open file: %w", err)
<mask> }
<mask>
<mask> reader = f
<mask> } else {
<mask> var resp *http.Response
<mask> resp, err = Context.client.Get(filter.URL)
</s> 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 </s> remove defer f.Close()
</s> add </s> add var resp *http.Response </s> remove func (u *Updater) downloadPackageFile(url, filename string) error {
resp, err := u.client.Get(url)
</s> add func (u *Updater) downloadPackageFile(url, filename string) (err error) {
var resp *http.Response
resp, err = u.client.Get(url) </s> remove defer file.Close()
</s> add defer func() { err = errors.WithDeferred(err, file.Close()) }() </s> remove r.Body, err = aghio.LimitReadCloser(r.Body, szLim)
</s> add var reader io.Reader
reader, err = aghio.LimitReader(r.Body, szLim) </s> remove var f io.WriteCloser
f, err = os.OpenFile(outputName, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, os.FileMode(header.Mode&0o777))
if err != nil {
err2 = fmt.Errorf("os.OpenFile(%s): %w", outputName, err)
break
}
_, err = io.Copy(f, tarReader)
if err != nil {
_ = f.Close()
err2 = fmt.Errorf("io.Copy(): %w", err)
break
}
err = f.Close()
if err != nil {
err2 = fmt.Errorf("f.Close(): %w", err)
break
</s> add err = os.Mkdir(outputName, fi.Mode())
if err != nil && !errors.Is(err, os.ErrExist) {
return "", fmt.Errorf("os.Mkdir(%q): %w", outputName, err) | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/home/filter.go |
keep keep keep keep replace keep keep keep keep keep | <mask> if err != nil {
<mask> return updated, fmt.Errorf("open file: %w", err)
<mask> }
<mask>
<mask> defer f.Close()
<mask> reader = f
<mask> } else {
<mask> var resp *http.Response
<mask> resp, err = Context.client.Get(filter.URL)
<mask> if err != nil {
</s> 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 </s> add defer func() { err = errors.WithDeferred(err, f.Close()) }() </s> add var resp *http.Response </s> remove defer file.Close()
</s> add defer func() { err = errors.WithDeferred(err, file.Close()) }() </s> remove func (u *Updater) downloadPackageFile(url, filename string) error {
resp, err := u.client.Get(url)
</s> add func (u *Updater) downloadPackageFile(url, filename string) (err error) {
var resp *http.Response
resp, err = u.client.Get(url) </s> remove defer f.Close()
</s> add defer func() {
derr := f.Close()
if derr != nil {
log.Error("etchostscontainer: closing file: %s", err)
}
}()
</s> remove defer f.Close()
fileReadCloser, err := aghio.LimitReadCloser(f, MaxFileSize)
</s> add defer func() {
derr := f.Close()
if derr != nil {
log.Error("glinet: closing file: %s", err)
}
}()
fileReader, err := aghio.LimitReader(f, MaxFileSize) | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/home/filter.go |
keep keep keep keep replace keep keep keep keep keep | <mask> if err != nil {
<mask> log.Printf("Couldn't request filter from URL %s, skipping: %s", filter.URL, err)
<mask> return updated, err
<mask> }
<mask> defer resp.Body.Close()
<mask>
<mask> if resp.StatusCode != http.StatusOK {
<mask> log.Printf("Got status code %d from URL %s, skipping", resp.StatusCode, filter.URL)
<mask> return updated, fmt.Errorf("got status code != 200: %d", resp.StatusCode)
<mask> }
</s> 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 </s> remove defer f.Close()
</s> add </s> remove defer f.Close()
</s> add defer func() {
derr := f.Close()
if derr != nil {
log.Error("etchostscontainer: closing file: %s", err)
}
}()
</s> remove resp.Body, err = aghio.LimitReadCloser(resp.Body, MaxPackageFileSize)
</s> add var r io.Reader
r, err = aghio.LimitReader(resp.Body, MaxPackageFileSize) </s> remove defer resp.Body.Close()
</s> add defer func() { err = errors.WithDeferred(err, resp.Body.Close()) }() </s> add defer func() { err = errors.WithDeferred(err, f.Close()) }() </s> remove defer file.Close()
</s> add defer func() { err = errors.WithDeferred(err, file.Close()) }() | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/home/filter.go |
keep keep keep keep replace keep keep keep keep keep | <mask> return nil
<mask> } else if err != nil {
<mask> return fmt.Errorf("opening filter file: %w", err)
<mask> }
<mask> defer file.Close()
<mask>
<mask> st, err := file.Stat()
<mask> if err != nil {
<mask> return fmt.Errorf("getting filter file stat: %w", err)
<mask> }
</s> 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 </s> remove defer f.Close()
</s> add </s> remove }
</s> add } else if err != nil {
err = fmt.Errorf("tarReader.Next(): %w", err) </s> add defer func() { err = errors.WithDeferred(err, f.Close()) }() </s> remove defer r.Close()
</s> add defer func() {
derr := r.Close()
if derr != nil {
log.Error("querylog: closing file: %s", err)
}
}() </s> remove defer f.Close()
</s> add defer func() { err = errors.WithDeferred(err, f.Close()) }() </s> remove var stdoutLimited io.ReadCloser
stdoutLimited, err = aghio.LimitReadCloser(stdout, aghos.MaxCmdOutputSize)
</s> add var stdoutLimited io.Reader
stdoutLimited, err = aghio.LimitReader(stdout, aghos.MaxCmdOutputSize) | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/home/filter.go |
keep keep keep keep replace keep keep keep keep keep | <mask> import (
<mask> "context"
<mask> "crypto/tls"
<mask> "crypto/x509"
<mask> "errors"
<mask> "fmt"
<mask> "io/fs"
<mask> "net"
<mask> "net/http"
<mask> "net/http/pprof"
</s> 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 </s> remove "errors"
</s> add </s> remove "errors"
</s> add </s> remove "errors"
</s> add </s> remove "errors"
</s> add </s> remove "errors"
</s> add </s> remove "errors"
</s> add | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/home/home.go |
keep keep keep keep replace keep keep keep keep keep | <mask> "sync"
<mask> "syscall"
<mask> "time"
<mask>
<mask> "github.com/AdguardTeam/AdGuardHome/internal/agherr"
<mask> "github.com/AdguardTeam/AdGuardHome/internal/aghnet"
<mask> "github.com/AdguardTeam/AdGuardHome/internal/aghos"
<mask> "github.com/AdguardTeam/AdGuardHome/internal/dhcpd"
<mask> "github.com/AdguardTeam/AdGuardHome/internal/dnsforward"
<mask> "github.com/AdguardTeam/AdGuardHome/internal/filtering"
</s> 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 </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/home/home.go |
keep add keep keep keep keep keep | <mask> "github.com/AdguardTeam/AdGuardHome/internal/updater"
<mask> "github.com/AdguardTeam/AdGuardHome/internal/version"
<mask> "github.com/AdguardTeam/golibs/log"
<mask> "gopkg.in/natefinch/lumberjack.v2"
<mask> )
<mask>
<mask> const (
</s> 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 </s> add "github.com/AdguardTeam/golibs/errors" </s> add "github.com/AdguardTeam/golibs/errors" </s> add "github.com/AdguardTeam/golibs/errors" </s> add "github.com/AdguardTeam/golibs/errors" </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add "github.com/AdguardTeam/golibs/errors" </s> add "github.com/AdguardTeam/golibs/errors" | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/home/home.go |
keep keep keep keep replace keep keep keep keep keep | <mask>
<mask> return conn, err
<mask> }
<mask>
<mask> return nil, agherr.Many(fmt.Sprintf("couldn't dial to %s", addr), dialErrs...)
<mask> }
<mask>
<mask> func getHTTPProxy(_ *http.Request) (*url.URL, error) {
<mask> if config.ProxyURL == "" {
<mask> return nil, nil
</s> 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 </s> remove return nil, "", errors.New("tls: failed to parse private key")
</s> add return nil, "", errors.Error("tls: failed to parse private key") </s> remove return nil, errors.New("couldn't find any legible interface")
</s> add return nil, errors.Error("couldn't find any legible interface") </s> remove defer agherr.Annotate("normalizing %q: %w", &err, hostname)
</s> add defer func() { err = errors.Annotate(err, "normalizing %q: %w", hostname) }() </s> remove defer agherr.LogPanic("systemResolvers")
</s> add defer log.OnPanic("systemResolvers")
</s> remove return dnscc, agherr.Error("no dnscrypt_config_file")
</s> add return dnscc, errors.Error("no dnscrypt_config_file") </s> remove defer func() {
_ = f.Close()
}()
</s> add defer func() { err = errors.WithDeferred(err, f.Close()) }() | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/home/home.go |
keep keep add keep keep keep keep keep keep | <mask> package home
<mask>
<mask> import (
<mask> "net/http"
<mask>
<mask> "github.com/AdguardTeam/AdGuardHome/internal/aghio"
<mask>
<mask> "github.com/AdguardTeam/golibs/log"
<mask> )
</s> 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 </s> remove "errors"
</s> add </s> add "net/http" </s> remove "errors"
</s> add </s> remove "errors"
</s> add </s> remove "errors"
</s> add </s> remove "errors"
</s> add | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/home/middlewares.go |
keep keep keep keep replace keep keep keep keep keep | <mask> if expectsLargerRequests(r) {
<mask> szLim = largerReqBodySzLim
<mask> }
<mask>
<mask> r.Body, err = aghio.LimitReadCloser(r.Body, szLim)
<mask> if err != nil {
<mask> log.Error("limitRequestBody: %s", err)
<mask>
<mask> return
<mask> }
</s> 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 </s> remove defer f.Close()
fileReadCloser, err := aghio.LimitReadCloser(f, MaxFileSize)
</s> add defer func() {
derr := f.Close()
if derr != nil {
log.Error("glinet: closing file: %s", err)
}
}()
fileReader, err := aghio.LimitReader(f, MaxFileSize) </s> remove defer r.Close()
</s> add defer func() {
derr := r.Close()
if derr != nil {
log.Error("querylog: closing file: %s", err)
}
}() </s> remove defer f.Close()
</s> add defer func() {
derr := f.Close()
if derr != nil {
log.Error("etchostscontainer: closing file: %s", err)
}
}()
</s> remove defer f.Close()
</s> add defer func() { err = errors.WithDeferred(err, f.Close()) }() </s> remove err := e.Encode(entry)
</s> add err = e.Encode(entry) </s> remove }
</s> add } else if err != nil {
err = fmt.Errorf("tarReader.Next(): %w", err) | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/home/middlewares.go |