diff options
Diffstat (limited to 'proc.go')
| -rw-r--r-- | proc.go | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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) |
