Fix process linter errors

This commit is contained in:
Daniel
2020-04-10 13:19:17 +02:00
parent c20c73a2d8
commit bb778f2cf7
9 changed files with 28 additions and 16 deletions

View File

@@ -178,7 +178,7 @@ func GetUDP6PacketInfo(localIP net.IP, localPort uint16, remoteIP net.IP, remote
return -1, pktDirection, nil
}
func search(connections, listeners []*ConnectionEntry, localIP, remoteIP net.IP, localPort, remotePort uint16, pktDirection bool) (pid int, direction bool) {
func search(connections, listeners []*ConnectionEntry, localIP, remoteIP net.IP, localPort, remotePort uint16, pktDirection bool) (pid int, direction bool) { //nolint:unparam // TODO: use direction, it may not be used because results caused problems, investigate.
lock.RLock()
defer lock.RUnlock()

View File

@@ -37,7 +37,7 @@ func New() (*IPHelper, error) {
// load dll
new.dll = windows.NewLazySystemDLL("iphlpapi.dll")
new.dll.Load()
err = new.dll.Load()
if err != nil {
return nil, err
}

View File

@@ -59,14 +59,14 @@ type iphelperTCP6Table struct {
type iphelperTCP6Row struct {
// docs: https://msdn.microsoft.com/en-us/library/windows/desktop/aa366896(v=vs.85).aspx
localAddr [16]byte
localScopeID uint32
localPort uint32
remoteAddr [16]byte
remoteScopeID uint32
remotePort uint32
state uint32
owningPid uint32
localAddr [16]byte
_ uint32 // localScopeID
localPort uint32
remoteAddr [16]byte
_ uint32 // remoteScopeID
remotePort uint32
state uint32
owningPid uint32
}
type iphelperUDPTable struct {
@@ -90,10 +90,10 @@ type iphelperUDP6Table struct {
type iphelperUDP6Row struct {
// docs: https://msdn.microsoft.com/en-us/library/windows/desktop/aa366923(v=vs.85).aspx
localAddr [16]byte
localScopeID uint32
localPort uint32
owningPid uint32
localAddr [16]byte
_ uint32 // localScopeID
localPort uint32
owningPid uint32
}
// IP and Protocol constants
@@ -137,7 +137,7 @@ func increaseBufSize() int {
defer bufSizeLock.Unlock()
// increase
bufSize = bufSize * 2
bufSize *= 2
// not too much
if bufSize > 65536 {
bufSize = 65536
@@ -149,7 +149,7 @@ func increaseBufSize() int {
}
// GetTables returns the current connection state table of Windows of the given protocol and IP version.
func (ipHelper *IPHelper) GetTables(protocol uint8, ipVersion uint8) (connections []*ConnectionEntry, listeners []*ConnectionEntry, err error) {
func (ipHelper *IPHelper) GetTables(protocol uint8, ipVersion uint8) (connections []*ConnectionEntry, listeners []*ConnectionEntry, err error) { //nolint:gocognit,gocycle // TODO
// docs: https://msdn.microsoft.com/en-us/library/windows/desktop/aa365928(v=vs.85).aspx
if !ipHelper.valid.IsSet() {

View File

@@ -1,3 +1,5 @@
// +build linux
package proc
import (

View File

@@ -1,3 +1,5 @@
// +build linux
package proc
import (

View File

@@ -1,3 +1,5 @@
// +build linux
package proc
import (

View File

@@ -1,3 +1,5 @@
// +build linux
package proc
import (

View File

@@ -1,3 +1,5 @@
// +build linux
package proc
import (

View File

@@ -1,3 +1,5 @@
// +build linux
package proc
import (