docs: fix issue template (#5541)
Fixes an issue with the issue templates. Signed-off-by: James Elliott <james-d-elliott@users.noreply.github.com>pull/5544/head
parent
19de724937
commit
4adefd3ef6
|
@ -6,7 +6,6 @@ import (
|
|||
"net/url"
|
||||
"strconv"
|
||||
"strings"
|
||||
"syscall"
|
||||
)
|
||||
|
||||
// NewAddress returns an *Address and error depending on the ability to parse the string as an Address.
|
||||
|
@ -381,25 +380,6 @@ func (a *Address) NetworkAddress() string {
|
|||
return a.url.Host
|
||||
}
|
||||
|
||||
// Listener creates and returns a net.Listener.
|
||||
func (a *Address) Listener() (ln net.Listener, err error) {
|
||||
if a.url == nil {
|
||||
return nil, fmt.Errorf("address url is nil")
|
||||
}
|
||||
|
||||
if a.socket && a.umask != -1 {
|
||||
umask := syscall.Umask(a.umask)
|
||||
|
||||
ln, err = net.Listen(a.Network(), a.NetworkAddress())
|
||||
|
||||
_ = syscall.Umask(umask)
|
||||
|
||||
return ln, err
|
||||
}
|
||||
|
||||
return net.Listen(a.Network(), a.NetworkAddress())
|
||||
}
|
||||
|
||||
// Dial creates and returns a dialed net.Conn.
|
||||
func (a *Address) Dial() (net.Conn, error) {
|
||||
if !a.valid || a.url == nil {
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
//go:build linux || freebsd || darwin || netbsd || solaris
|
||||
|
||||
package schema
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net"
|
||||
"syscall"
|
||||
)
|
||||
|
||||
// Listener creates and returns a net.Listener.
|
||||
func (a *Address) Listener() (ln net.Listener, err error) {
|
||||
if a.url == nil {
|
||||
return nil, fmt.Errorf("address url is nil")
|
||||
}
|
||||
|
||||
if a.socket && a.umask != -1 {
|
||||
umask := syscall.Umask(a.umask)
|
||||
|
||||
ln, err = net.Listen(a.Network(), a.NetworkAddress())
|
||||
|
||||
_ = syscall.Umask(umask)
|
||||
|
||||
return ln, err
|
||||
}
|
||||
|
||||
return net.Listen(a.Network(), a.NetworkAddress())
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
//go:build !linux && !freebsd && !darwin && !netbsd && !solaris
|
||||
|
||||
package schema
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net"
|
||||
)
|
||||
|
||||
// Listener creates and returns a net.Listener.
|
||||
func (a *Address) Listener() (ln net.Listener, err error) {
|
||||
if a.url == nil {
|
||||
return nil, fmt.Errorf("address url is nil")
|
||||
}
|
||||
|
||||
return net.Listen(a.Network(), a.NetworkAddress())
|
||||
}
|
Loading…
Reference in New Issue