From 45916f5f2bf10373bd26fc0c353a4b1ecc79be5a Mon Sep 17 00:00:00 2001 From: Tom Thorogood Date: Sun, 12 Mar 2023 20:43:38 +1030 Subject: [PATCH] Remove pre-go1.11 support from reuseport code (#1431) --- listen_no_reuseport.go | 4 ++-- listen_reuseport.go | 3 +-- server.go | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/listen_no_reuseport.go b/listen_no_reuseport.go index 65ac91021..6ed50f86b 100644 --- a/listen_no_reuseport.go +++ b/listen_no_reuseport.go @@ -1,5 +1,5 @@ -//go:build !go1.11 || (!aix && !darwin && !dragonfly && !freebsd && !linux && !netbsd && !openbsd) -// +build !go1.11 !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd +//go:build !aix && !darwin && !dragonfly && !freebsd && !linux && !netbsd && !openbsd +// +build !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd package dns diff --git a/listen_reuseport.go b/listen_reuseport.go index 89e6c98bc..89bac9034 100644 --- a/listen_reuseport.go +++ b/listen_reuseport.go @@ -1,5 +1,4 @@ -//go:build go1.11 && (aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd) -// +build go1.11 +//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd // +build aix darwin dragonfly freebsd linux netbsd openbsd package dns diff --git a/server.go b/server.go index 508e9cb37..64e388546 100644 --- a/server.go +++ b/server.go @@ -224,7 +224,7 @@ type Server struct { // Maximum number of TCP queries before we close the socket. Default is maxTCPQueries (unlimited if -1). MaxTCPQueries int // Whether to set the SO_REUSEPORT socket option, allowing multiple listeners to be bound to a single address. - // It is only supported on go1.11+ and when using ListenAndServe. + // It is only supported on certain GOOSes and when using ListenAndServe. ReusePort bool // AcceptMsgFunc will check the incoming message and will reject it early in the process. // By default DefaultMsgAcceptFunc will be used.