Skip to content

Commit 6237a19

Browse files
committed
fix: ST1008 - template
1 parent b51279c commit 6237a19

File tree

1 file changed

+5
-5
lines changed
  • field/generator/internal/templates/element

1 file changed

+5
-5
lines changed

field/generator/internal/templates/element/vector.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,28 +70,28 @@ func (vector *Vector) WriteTo(w io.Writer) (int64, error) {
7070
// It also returns a channel that will be closed when the validation is done.
7171
// The validation consist of checking that the elements are smaller than the modulus, and
7272
// converting them to montgomery form.
73-
func (vector *Vector) AsyncReadFrom(r io.Reader) (int64, error, chan error) {
73+
func (vector *Vector) AsyncReadFrom(r io.Reader) (int64, chan error, error) {
7474
chErr := make(chan error, 1)
7575
var buf [Bytes]byte
7676
if read, err := io.ReadFull(r, buf[:4]); err != nil {
7777
close(chErr)
78-
return int64(read), err, chErr
78+
return int64(read), chErr, err
7979
}
8080
sliceLen := binary.BigEndian.Uint32(buf[:4])
8181
8282
n := int64(4)
8383
(*vector) = make(Vector, sliceLen)
8484
if sliceLen == 0 {
8585
close(chErr)
86-
return n, nil, chErr
86+
return n, chErr, nil
8787
}
8888
8989
bSlice := unsafe.Slice((*byte)(unsafe.Pointer(&(*vector)[0])), sliceLen*Bytes)
9090
read, err := io.ReadFull(r, bSlice)
9191
n += int64(read)
9292
if err != nil {
9393
close(chErr)
94-
return n, err, chErr
94+
return n, chErr, err
9595
}
9696
9797
@@ -128,7 +128,7 @@ func (vector *Vector) AsyncReadFrom(r io.Reader) (int64, error, chan error) {
128128
}
129129
close(chErr)
130130
}()
131-
return n, nil, chErr
131+
return n, chErr, nil
132132
}
133133
134134
// ReadFrom implements io.ReaderFrom and reads a vector of big endian encoded {{.ElementName}}.

0 commit comments

Comments
 (0)