Skip to content

Commit

Permalink
Change the type of variable isUDP to local
Browse files Browse the repository at this point in the history
  • Loading branch information
alebsys committed Jun 26, 2023
1 parent 86730e6 commit 54278a0
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions net_ip_socket.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,6 @@ import (
"strings"
)

var (
// isUDP is used to determine the type of network socket UDP or TCP.
// Further its value will be used to parse UDP-specific fields from /proc/net/udp{,6} files.
isUDP bool
)

const (
// readLimit is used by io.LimitReader while reading the content of the
// /proc/net/udp{,6} files. The number of lines inside such a file is dynamic
Expand Down Expand Up @@ -87,7 +81,7 @@ func newNetIPSocket(file string) (NetIPSocket, error) {
defer f.Close()

var netIPSocket NetIPSocket
var isUDP bool
var isUDP bool // is used to determine the type of network socket UDP or TCP

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

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

if strings.Contains(file, "udp") {
isUDP = true
Expand Down

0 comments on commit 54278a0

Please sign in to comment.