summaryrefslogtreecommitdiff
path: root/proc.go
diff options
context:
space:
mode:
Diffstat (limited to 'proc.go')
-rw-r--r--proc.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/proc.go b/proc.go
index b7720e0..a37e476 100644
--- a/proc.go
+++ b/proc.go
@@ -26,7 +26,7 @@ func GetProcessNameByPort(port int) string {
for _, line := range lines {
fields := strings.Fields(line)
log.Log(PROC, "searchProcNet() portHex:", portHex)
- if (len(fields) > 9) {
+ if len(fields) > 9 {
log.Log(PROC, "searchProcNet() fields[9]", fields[9])
}
log.Log(PROC, "searchProcNet() lines:", line)
@@ -36,7 +36,7 @@ func GetProcessNameByPort(port int) string {
// Convert the hexadecimal string to an integer
value, _ := strconv.ParseInt(parts[1], 16, 64)
log.Log(PROC, "searchProcNet() value, port =", value, port, "parts[1] =", parts[1])
- if (port == int(value)) {
+ if port == int(value) {
log.Log(PROC, "searchProcNet() THIS IS THE LINE:", fields)
return fields[9]
}
@@ -70,7 +70,7 @@ func GetProcessNameByPort(port int) string {
for _, fd := range fds {
fdLink, _ := os.Readlink(filepath.Join(fdPath, fd.Name()))
var s string
- s = "socket:["+inode+"]"
+ s = "socket:[" + inode + "]"
if strings.Contains(fdLink, "socket:[") {
log.Log(PROC, "searchProcNet() fdLink has socket:", fdLink)
log.Log(PROC, "searchProcNet() proc.Name() =", proc.Name(), "s =", s)