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
James Elliott 2023-06-08 09:18:35 +10:00 committed by GitHub
parent 19de724937
commit 4adefd3ef6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 130 additions and 105 deletions

View File

@ -6,7 +6,6 @@ import (
"net/url" "net/url"
"strconv" "strconv"
"strings" "strings"
"syscall"
) )
// NewAddress returns an *Address and error depending on the ability to parse the string as an Address. // 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 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. // Dial creates and returns a dialed net.Conn.
func (a *Address) Dial() (net.Conn, error) { func (a *Address) Dial() (net.Conn, error) {
if !a.valid || a.url == nil { if !a.valid || a.url == nil {

View File

@ -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())
}

View File

@ -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())
}