(*NativeTun).operateOnFd is only used on darwin and freebsd. Adjust the build tags accordingly. Signed-off-by: Tobias Klauser <tklauser@distanz.ch> --- tun/operateonfd.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tun/operateonfd.go b/tun/operateonfd.go index aab71161f27c..bc804539169f 100644 --- a/tun/operateonfd.go +++ b/tun/operateonfd.go @@ -1,5 +1,5 @@ -//go:build !windows -// +build !windows +//go:build darwin || freebsd +// +build darwin freebsd /* SPDX-License-Identifier: MIT * -- 2.33.0
I've applied this. Thanks for the patch. Though I do wonder: it's functionally the same as before, right? What instances lead to this being an issue? Or did this way just seem more correct?
On 2021-09-23 at 17:54:59 +0200, Jason A. Donenfeld <Jason@zx2c4.com> wrote:
> I've applied this. Thanks for the patch. Though I do wonder: it's
> functionally the same as before, right? What instances lead to this
> being an issue? Or did this way just seem more correct?
Thanks. Functionally it's the same, yes. I noticed this when running
staticcheck against wireguard-go on Linux and it reported
(*NativeTun).operateOnFd as being defined but not used. So it just
seemed more correct to only define it for platforms that actually use
it.