tun: make operateonfd.go build tags more specific
PATCH 1/1 tun: make operateonfd.go build tags more specific
(*NativeTun).operateOnFd is only used on darwin and freebsd. Adjust the build tags accordingly.
--- tun/operateonfd.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
tun/operateonfd.go +2 -2
@@ -1,5 +1,5 @@ -//go:build !windows -// +build !windows +//go:build darwin || freebsd +// +build darwin freebsd /* SPDX-License-Identifier: MIT *
Signature · 1 line
2.33.0
Jason A. Donenfeld
AppliedI'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?
Quoted 3 lines · Jason A. Donenfeld
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.