Update dependencies and fix some linter warnings
This commit is contained in:
@@ -124,7 +124,7 @@ func (s *HoneypotServer) connCallback(ctx sshlib.Context, conn net.Conn) net.Con
|
||||
|
||||
func handler(session sshlib.Session) {
|
||||
_, _ = io.WriteString(session, "[root@hostname ~]#")
|
||||
session.Exit(1)
|
||||
_ = session.Exit(1)
|
||||
}
|
||||
|
||||
func ipFromAddr(addr string) net.IP {
|
||||
|
@@ -77,7 +77,7 @@ func NewMetricsCollectingStore(ctx context.Context, store LoginAttemptStore) *Me
|
||||
case <-ctx.Done():
|
||||
return
|
||||
case <-mcs.statsTicker.C:
|
||||
mcs.Stats(LoginStatsTotals, 0)
|
||||
mcs.Stats(LoginStatsTotals, 0) // nolint: errcheck
|
||||
}
|
||||
}
|
||||
}()
|
||||
@@ -116,7 +116,6 @@ func (s *MetricsCollectingStore) Stats(statType LoginStats, limit int) ([]StatsR
|
||||
}
|
||||
}
|
||||
return stats, err
|
||||
|
||||
}
|
||||
|
||||
func (s *MetricsCollectingStore) Query(query AttemptQuery) ([]models.LoginAttempt, error) {
|
||||
|
@@ -53,7 +53,7 @@ RETURNING id;`
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer tx.Rollback()
|
||||
defer tx.Rollback() // nolint: errcheck
|
||||
|
||||
var id int
|
||||
if err := tx.QueryRow(stmt, l.Date, l.RemoteIP.String(), l.Username, l.Password, l.SSHClientVersion, l.ConnectionUUID, l.Country).Scan(&id); err != nil {
|
||||
|
@@ -1,3 +1,4 @@
|
||||
// nolint: errcheck
|
||||
package store_test
|
||||
|
||||
import (
|
||||
@@ -27,6 +28,7 @@ func TestPostgresStore(t *testing.T) {
|
||||
|
||||
testLoginAttemptStore(s, t)
|
||||
}
|
||||
|
||||
func TestPostgresStoreWithCache(t *testing.T) {
|
||||
var dsn string
|
||||
var found bool
|
||||
@@ -47,6 +49,7 @@ func TestPostgresStoreWithCache(t *testing.T) {
|
||||
|
||||
testLoginAttemptStore(s, t)
|
||||
}
|
||||
|
||||
func BenchmarkPostgresStore(b *testing.B) {
|
||||
var dsn string
|
||||
var found bool
|
||||
|
Reference in New Issue
Block a user