diff options
| author | Will Hawkins <[email protected]> | 2022-06-22 15:10:07 -0400 |
|---|---|---|
| committer | Will Hawkins <[email protected]> | 2022-06-22 15:10:07 -0400 |
| commit | 0609b02f82321577ba80cd368c6085fd0442f3f7 (patch) | |
| tree | 782f966243f9d2dbcd328837a2cdf9ce5c1f948b /extendedstats/darwin.go | |
| parent | 8595ff279dc46e3f974661e29686af3de5e01026 (diff) | |
[Cleanup] Make long lines shorter and fix static fmt warnings
Besides running golines (for the first time in a while now that
the tool supports generics), this commit removes punctuation and
newlines from Errorf parameters -- something that gofmt does not
like (I never knew!).
Diffstat (limited to 'extendedstats/darwin.go')
| -rw-r--r-- | extendedstats/darwin.go | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/extendedstats/darwin.go b/extendedstats/darwin.go index 788e36c..92e48fc 100644 --- a/extendedstats/darwin.go +++ b/extendedstats/darwin.go @@ -32,14 +32,18 @@ func ExtendedStatsAvailable() bool { func (es *ExtendedStats) IncorporateConnectionStats(rawConn net.Conn) error { tlsConn, ok := rawConn.(*tls.Conn) if !ok { - return fmt.Errorf("OOPS: Could not get the TCP info for the connection (not a TLS connection)!\n") + return fmt.Errorf( + "OOPS: Could not get the TCP info for the connection (not a TLS connection)", + ) } tcpConn, ok := tlsConn.NetConn().(*net.TCPConn) if !ok { - return fmt.Errorf("OOPS: Could not get the TCP info for the connection (not a TCP connection)!\n") + return fmt.Errorf( + "OOPS: Could not get the TCP info for the connection (not a TCP connection)", + ) } if info, err := getTCPConnectionInfo(tcpConn); err != nil { - return fmt.Errorf("OOPS: Could not get the TCP info for the connection: %v!\n", err) + return fmt.Errorf("OOPS: Could not get the TCP info for the connection: %v", err) } else { es.Maxseg = utilities.Max(es.Maxseg, uint64(info.Maxseg)) es.TotalReorderings += info.Rxoutoforderbytes @@ -75,7 +79,11 @@ func getTCPConnectionInfo(connection net.Conn) (*unix.TCPConnectionInfo, error) var info *unix.TCPConnectionInfo = nil rawConn.Control(func(fd uintptr) { - info, err = unix.GetsockoptTCPConnectionInfo(int(fd), unix.IPPROTO_TCP, unix.TCP_CONNECTION_INFO) + info, err = unix.GetsockoptTCPConnectionInfo( + int(fd), + unix.IPPROTO_TCP, + unix.TCP_CONNECTION_INFO, + ) }) return info, err } |
