uses old error checking
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Marvin Steadfast 2021-01-21 11:54:26 +01:00
parent a5695600e2
commit 2fb6cbcaf1

5
wg.go
View File

@ -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)