修复freebsd编译时的错误

This commit is contained in:
刘祥超
2021-10-22 15:38:53 +08:00
parent 388e7d2683
commit 4dcd47d8bc

View File

@@ -1,3 +1,6 @@
//go:build !freebsd
// +build !freebsd
package utils package utils
import ( import (
@@ -7,7 +10,7 @@ import (
"syscall" "syscall"
) )
// 监听可重用的端口 // ListenReuseAddr 监听可重用的端口
func ListenReuseAddr(network string, addr string) (net.Listener, error) { func ListenReuseAddr(network string, addr string) (net.Listener, error) {
config := &net.ListenConfig{ config := &net.ListenConfig{
Control: func(network, address string, c syscall.RawConn) error { Control: func(network, address string, c syscall.RawConn) error {