@@ -325,7 +325,7 @@ func (a Allocation) Encode(w io.Writer) error {
325325 err , "invalid allocations cannot be encoded, got %v" , a )
326326 }
327327 // encode dimensions
328- if err := perunio .Encode (w , Index (len (a .Assets )), Index (len (a .Balances [0 ])), Index (len (a .Locked ))); err != nil {
328+ if err := perunio .Encode (w , Index (len (a .Assets )), Index (len (a .Balances [0 ])), Index (len (a .Locked ))); err != nil { //nolint:gosec
329329 return err
330330 }
331331 // encode assets
@@ -436,7 +436,7 @@ func (b Balances) Encode(w io.Writer) error {
436436 return errors .Errorf ("expected maximum number of parts %d, got %d" , MaxNumParts , numParts )
437437 }
438438
439- if err := perunio .Encode (w , Index (numAssets ), Index (numParts )); err != nil {
439+ if err := perunio .Encode (w , Index (numAssets ), Index (numParts )); err != nil { //nolint:gosec
440440 return errors .WithMessage (err , "encoding dimensions" )
441441 }
442442 for i := range b {
@@ -667,7 +667,7 @@ func (s SubAlloc) Encode(w io.Writer) error {
667667 err , "invalid sub-allocations cannot be encoded, got %v" , s )
668668 }
669669 // encode ID and dimension
670- if err := perunio .Encode (w , IDMap (s .ID ), Index (len (s .Bals ))); err != nil {
670+ if err := perunio .Encode (w , IDMap (s .ID ), Index (len (s .Bals ))); err != nil { //nolint:gosec
671671 return errors .WithMessagef (
672672 err , "encoding sub-allocation ID or dimension, id %v" , s .ID )
673673 }
@@ -679,7 +679,7 @@ func (s SubAlloc) Encode(w io.Writer) error {
679679 }
680680 }
681681 // Encode IndexMap.
682- if err := perunio .Encode (w , Index (len (s .IndexMap ))); err != nil {
682+ if err := perunio .Encode (w , Index (len (s .IndexMap ))); err != nil { //nolint:gosec
683683 return errors .WithMessage (err , "encoding length of index map" )
684684 }
685685 for i , x := range s .IndexMap {
0 commit comments