From 433d83e63678e4483e1d8af2e522c7b05c7d7909 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Sun, 21 Jan 2024 02:23:47 -0600 Subject: fix name changes new gadgets correct go mod updated paths Signed-off-by: Jeff Carr --- proc.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'proc.go') 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) -- cgit v1.2.3