From 2fb6cbcaf11d6073d910714eb4239225d0ea494c Mon Sep 17 00:00:00 2001 From: Marvin Steadfast Date: Thu, 21 Jan 2021 11:54:26 +0100 Subject: [PATCH] uses old error checking --- wg.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/wg.go b/wg.go index 76d4b2a..33bf528 100644 --- a/wg.go +++ b/wg.go @@ -1,3 +1,4 @@ +// nolint: errorlint package wgquick import ( @@ -48,7 +49,7 @@ func Up(cfg *Config, iface string, logger logrus.FieldLogger) error { return os.ErrExist } - if errors.As(err, &netlink.LinkNotFoundError{}) { + if _, ok := err.(netlink.LinkNotFoundError); !ok { return fmt.Errorf("%w", err) } @@ -226,7 +227,7 @@ func SyncLink(cfg *Config, iface string, log logrus.FieldLogger) (netlink.Link, link, err := netlink.LinkByName(iface) // nolint: nestif if err != nil { - if errors.As(err, &netlink.LinkNotFoundError{}) { + if _, ok := err.(netlink.LinkNotFoundError); !ok { log.WithError(err).Error("cannot read link") return nil, fmt.Errorf("%w", err)