Skip to content

Commit 747c87c

Browse files
committed
stylecheck: ST1016: methods on the same type should have the same receiver name
1 parent d8ac9ec commit 747c87c

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

libvirt/uri/connection_uri.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ import (
88
"net"
99
"net/url"
1010
"strings"
11+
"time"
12+
)
13+
14+
const (
15+
dialTimeout = 2*time.Second
1116
)
1217

1318
type ConnectionURI struct {

libvirt/uri/tcp.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,17 @@ package uri
33
import (
44
"fmt"
55
"net"
6-
"time"
76
)
87

98
const (
109
defaultTCPPort = "16509"
1110
)
1211

13-
func (c *ConnectionURI) dialTCP() (net.Conn, error) {
14-
port := c.Port()
12+
func (u *ConnectionURI) dialTCP() (net.Conn, error) {
13+
port := u.Port()
1514
if port == "" {
1615
port = defaultTCPPort
1716
}
1817

19-
return net.DialTimeout("tcp", fmt.Sprintf("%s:%s", c.Hostname(), port), 2*time.Second)
18+
return net.DialTimeout("tcp", fmt.Sprintf("%s:%s", u.Hostname(), port), dialTimeout)
2019
}

0 commit comments

Comments
 (0)