aboutsummaryrefslogtreecommitdiffstats
path: root/tun/tun_linux.go
diff options
context:
space:
mode:
authorJordan Whited <jordan@tailscale.com>2023-03-16 13:27:51 -0700
committerJason A. Donenfeld <Jason@zx2c4.com>2023-03-17 15:18:04 +0100
commit1417a47c8fa816f427ac56ebe79a90a97a01aef5 (patch)
tree9530f2932814c081e4f1a17732221f86ca7f7e27 /tun/tun_linux.go
parentgo.mod: bump to Go 1.20 (diff)
downloadwireguard-go-1417a47c8fa816f427ac56ebe79a90a97a01aef5.tar.xz
wireguard-go-1417a47c8fa816f427ac56ebe79a90a97a01aef5.zip
tun: replace ErrorBatch() with errors.Join()
Reviewed-by: Maisem Ali <maisem@tailscale.com> Signed-off-by: Jordan Whited <jordan@tailscale.com> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to '')
-rw-r--r--tun/tun_linux.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/tun/tun_linux.go b/tun/tun_linux.go
index 7a96d47..12cd49f 100644
--- a/tun/tun_linux.go
+++ b/tun/tun_linux.go
@@ -338,7 +338,7 @@ func (tun *NativeTun) Write(bufs [][]byte, offset int) (int, error) {
tun.writeOpMu.Unlock()
}()
var (
- errs []error
+ errs error
total int
)
tun.toWrite = tun.toWrite[:0]
@@ -359,12 +359,12 @@ func (tun *NativeTun) Write(bufs [][]byte, offset int) (int, error) {
return total, os.ErrClosed
}
if err != nil {
- errs = append(errs, err)
+ errs = errors.Join(errs, err)
} else {
total += n
}
}
- return total, ErrorBatch(errs)
+ return total, errs
}
// handleVirtioRead splits in into bufs, leaving offset bytes at the front of