Remove unneeded error context wrapping

This commit is contained in:
Quentin McGaw
2025-10-14 17:56:54 +00:00
parent 5428580b8f
commit 906e7b5ee1
2 changed files with 2 additions and 2 deletions

View File

@@ -40,7 +40,7 @@ func listenICMPv4(ctx context.Context) (conn net.PacketConn, err error) {
if strings.HasSuffix(err.Error(), "socket: operation not permitted") {
err = fmt.Errorf("%w: you can try adding NET_RAW capability to resolve this", ErrICMPNotPermitted)
}
return nil, fmt.Errorf("listening for ICMP packets: %w", err)
return nil, err
}
if runtime.GOOS == "darwin" || runtime.GOOS == "ios" {

View File

@@ -25,7 +25,7 @@ func listenICMPv6(ctx context.Context) (conn net.PacketConn, err error) {
if strings.HasSuffix(err.Error(), "socket: operation not permitted") {
err = fmt.Errorf("%w: you can try adding NET_RAW capability to resolve this", ErrICMPNotPermitted)
}
return nil, fmt.Errorf("listening for ICMPv6 packets: %w", err)
return nil, err
}
return packetConn, nil
}