]> git.ipfire.org Git - thirdparty/wireguard-go.git/commitdiff
tun: fix fmt.Errorf format strings
authorJosh Bleecher Snyder <josh@tailscale.com>
Tue, 19 Jan 2021 21:39:48 +0000 (13:39 -0800)
committerJason A. Donenfeld <Jason@zx2c4.com>
Wed, 20 Jan 2021 19:03:40 +0000 (20:03 +0100)
Type tcpip.Error is not an error.

I've filed https://github.com/google/gvisor/issues/5314
to fix this upstream.

Until that is fixed, use %v instead of %w,
to keep vet happy.

Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
tun/tun_net.go

index 854334195d5e26375df8e9d45344daa4e42e9f96..9a6f26f690ed94dd67b0b5ea4df38c65adaf091a 100644 (file)
@@ -103,19 +103,19 @@ func CreateNetTUN(localAddresses []net.IP, dnsServers []net.IP, mtu int) (Device
        }
        tcpipErr := dev.stack.CreateNIC(1, (*endpoint)(dev))
        if tcpipErr != nil {
-               return nil, nil, fmt.Errorf("CreateNIC: %w", tcpipErr)
+               return nil, nil, fmt.Errorf("CreateNIC: %v", tcpipErr)
        }
        for _, ip := range localAddresses {
                if ip4 := ip.To4(); ip4 != nil {
                        tcpipErr = dev.stack.AddAddress(1, ipv4.ProtocolNumber, tcpip.Address(ip4))
                        if tcpipErr != nil {
-                               return nil, nil, fmt.Errorf("AddAddress(%v): %w", ip4, tcpipErr)
+                               return nil, nil, fmt.Errorf("AddAddress(%v): %v", ip4, tcpipErr)
                        }
                        dev.hasV4 = true
                } else {
                        tcpipErr = dev.stack.AddAddress(1, ipv6.ProtocolNumber, tcpip.Address(ip))
                        if tcpipErr != nil {
-                               return nil, nil, fmt.Errorf("AddAddress(%v): %w", ip4, tcpipErr)
+                               return nil, nil, fmt.Errorf("AddAddress(%v): %v", ip4, tcpipErr)
                        }
                        dev.hasV6 = true
                }