This commit is contained in:
parent
a5695600e2
commit
2fb6cbcaf1
5
wg.go
5
wg.go
@ -1,3 +1,4 @@
|
|||||||
|
// nolint: errorlint
|
||||||
package wgquick
|
package wgquick
|
||||||
|
|
||||||
import (
|
import (
|
||||||
@ -48,7 +49,7 @@ func Up(cfg *Config, iface string, logger logrus.FieldLogger) error {
|
|||||||
return os.ErrExist
|
return os.ErrExist
|
||||||
}
|
}
|
||||||
|
|
||||||
if errors.As(err, &netlink.LinkNotFoundError{}) {
|
if _, ok := err.(netlink.LinkNotFoundError); !ok {
|
||||||
return fmt.Errorf("%w", err)
|
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)
|
link, err := netlink.LinkByName(iface)
|
||||||
// nolint: nestif
|
// nolint: nestif
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if errors.As(err, &netlink.LinkNotFoundError{}) {
|
if _, ok := err.(netlink.LinkNotFoundError); !ok {
|
||||||
log.WithError(err).Error("cannot read link")
|
log.WithError(err).Error("cannot read link")
|
||||||
|
|
||||||
return nil, fmt.Errorf("%w", err)
|
return nil, fmt.Errorf("%w", err)
|
||||||
|
Loading…
Reference in New Issue
Block a user