Skip to content

Commit

Permalink
ignore gosec in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
alovak committed Oct 4, 2024
1 parent ef898a3 commit abe233b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions connection_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"errors"
"fmt"
"io"
"math"
"net"
"net/http"
"sync"
Expand Down Expand Up @@ -1348,6 +1349,10 @@ func (m *messageIO) WriteMessage(w io.Writer, message *iso8583.Message) error {
}

// create header with message length
if len(rawMessage) > math.MaxUint16 {
return fmt.Errorf("message length is out of uint16 range: %d", len(rawMessage))
}
//nolint:gosec // disable G115 as it's a false positive
h := header{
Length: uint16(len(rawMessage)),
}
Expand Down
1 change: 1 addition & 0 deletions pool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ func TestPool(t *testing.T) {
// Then pool builds and connects connections to all servers
require.Eventually(t, func() bool {
// we expect connectionsCnt counter to be incremented by both servers
//nolint:gosec // disable G115
return atomic.LoadInt32(&connectionsCnt) == int32(serversToStart)
}, 500*time.Millisecond, 50*time.Millisecond, "%d expected connections established, but got %d", serversToStart, atomic.LoadInt32(&connectionsCnt))

Expand Down

0 comments on commit abe233b

Please sign in to comment.