Skip to content

Commit d6261d3

Browse files
alebsysАлександр Лебедев
authored andcommitted
Change the type of variable isUDP to local
Signed-off-by: Александр Лебедев <[email protected]>
1 parent 895c368 commit d6261d3

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

net_ip_socket.go

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,6 @@ import (
2424
"strings"
2525
)
2626

27-
var (
28-
// isUDP is used to determine the type of network socket UDP or TCP.
29-
// Further its value will be used to parse UDP-specific fields from /proc/net/udp{,6} files.
30-
isUDP bool
31-
)
32-
3327
const (
3428
// readLimit is used by io.LimitReader while reading the content of the
3529
// /proc/net/udp{,6} files. The number of lines inside such a file is dynamic
@@ -87,7 +81,7 @@ func newNetIPSocket(file string) (NetIPSocket, error) {
8781
defer f.Close()
8882

8983
var netIPSocket NetIPSocket
90-
var isUDP bool
84+
var isUDP bool // is used to determine the type of network socket UDP or TCP
9185

9286
if strings.Contains(file, "udp") {
9387
isUDP = true
@@ -120,6 +114,7 @@ func newNetIPSocketSummary(file string) (*NetIPSocketSummary, error) {
120114

121115
var netIPSocketSummary NetIPSocketSummary
122116
var udpPacketDrops uint64
117+
var isUDP bool // is used to determine the type of network socket UDP6 or TCP6
123118

124119
if strings.Contains(file, "udp") {
125120
isUDP = true

0 commit comments

Comments
 (0)