From 93a4313c3a809afe67f1dc430f544282af2b388c Mon Sep 17 00:00:00 2001 From: Josh Bleecher Snyder Date: Mon, 14 Dec 2020 13:30:38 -0800 Subject: [PATCH] device: accept any io.Reader in device.IpcSetOperation Any io.Reader will do, and there are no performance concerns here. This is technically backwards incompatible, but it is very unlikely to break any existing code. It is compatible with the existing uses in wireguard-{windows,android,apple} and also will allow us to slightly simplify it if desired. Signed-off-by: Josh Bleecher Snyder --- device/uapi.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/device/uapi.go b/device/uapi.go index 9f9c9bd..c0e522b 100644 --- a/device/uapi.go +++ b/device/uapi.go @@ -107,8 +107,8 @@ func (device *Device) IpcGetOperation(socket *bufio.Writer) error { return nil } -func (device *Device) IpcSetOperation(socket *bufio.Reader) error { - scanner := bufio.NewScanner(socket) +func (device *Device) IpcSetOperation(r io.Reader) error { + scanner := bufio.NewScanner(r) logError := device.log.Error logDebug := device.log.Debug