From 89bde64398e93c05573e078d01bf384ee29505b8 Mon Sep 17 00:00:00 2001 From: v-kamerdinerov Date: Wed, 4 Sep 2024 23:16:35 +0300 Subject: [PATCH] linter --- main.go | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/main.go b/main.go index be2ff88..3312c32 100644 --- a/main.go +++ b/main.go @@ -64,12 +64,12 @@ type Scanner struct { } type ScanResult struct { - IP string `json:"ip"` - Port string `json:"port"` - Ping int64 `json:"ping"` - TLSVersion string `json:"tls_version"` - ALPN string `json:"alpn"` - CommonName string `json:"common_name"` + IP string `json:"ip"` + Port string `json:"port"` + Ping int64 `json:"ping"` + TLSVersion string `json:"tls_version"` + ALPN string `json:"alpn"` + CommonName string `json:"common_name"` } func (f *CustomTextFormatter) Format(entry *logrus.Entry) ([]byte, error) { @@ -279,7 +279,10 @@ func (s *Scanner) Scan(ip net.IP) { remoteIP := remoteAddr.IP.String() port := remoteAddr.Port line := fmt.Sprintf("%s:%d", remoteIP, port) + "\t" - conn.SetDeadline(time.Now().Add(s.timeout)) + if err := conn.SetDeadline(time.Now().Add(s.timeout)); err != nil { + log.WithError(err).Error("Error setting deadline") + return + } c := tls.Client(conn, &tls.Config{ InsecureSkipVerify: true, NextProtos: []string{"h2", "http/1.1"},