chore: style fixes from go fix (#10846)
Just `go fix ./...` Signed-off-by: Jakob Borg <jakob@kastelo.net>
This commit is contained in:
@@ -81,7 +81,7 @@ func TestStressBufferPool(t *testing.T) {
|
||||
|
||||
var wg sync.WaitGroup
|
||||
fail := make(chan struct{}, routines)
|
||||
for i := 0; i < routines; i++ {
|
||||
for range routines {
|
||||
wg.Go(func() {
|
||||
for time.Since(t0) < runtime {
|
||||
blocks := make([][]byte, 10)
|
||||
|
||||
@@ -211,12 +211,10 @@ func (e encryptedConnection) Request(ctx context.Context, req *Request) ([]byte,
|
||||
|
||||
// Encrypt / adjust the request parameters.
|
||||
|
||||
encSize := req.Size
|
||||
if encSize < minPaddedSize {
|
||||
encSize := max(req.Size,
|
||||
// Make a request for minPaddedSize data instead of the smaller
|
||||
// block. We'll chop of the extra data later.
|
||||
encSize = minPaddedSize
|
||||
}
|
||||
minPaddedSize)
|
||||
encSize += blockOverhead
|
||||
encName := encryptName(req.Name, folderKey)
|
||||
encOffset := req.Offset + int64(req.BlockNo*blockOverhead)
|
||||
|
||||
@@ -56,7 +56,7 @@ func TestEnDecryptName(t *testing.T) {
|
||||
}
|
||||
for _, tc := range cases {
|
||||
var prev string
|
||||
for i := 0; i < 5; i++ {
|
||||
for range 5 {
|
||||
enc := encryptName(tc, &key)
|
||||
if prev != "" && prev != enc {
|
||||
t.Error("name should always encrypt the same")
|
||||
@@ -124,7 +124,7 @@ func TestEnDecryptBytes(t *testing.T) {
|
||||
}
|
||||
for _, tc := range cases {
|
||||
var prev []byte
|
||||
for i := 0; i < 5; i++ {
|
||||
for range 5 {
|
||||
enc := encryptBytes(tc, &key)
|
||||
if bytes.Equal(enc, prev) {
|
||||
t.Error("encryption should not repeat")
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
// You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
|
||||
//go:build darwin
|
||||
// +build darwin
|
||||
|
||||
package protocol
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
// You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
|
||||
//go:build !windows && !darwin
|
||||
// +build !windows,!darwin
|
||||
|
||||
package protocol
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
// You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
|
||||
//go:build windows
|
||||
// +build windows
|
||||
|
||||
package protocol
|
||||
|
||||
|
||||
@@ -310,7 +310,7 @@ func TestWriteCompressed(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestLZ4Compression(t *testing.T) {
|
||||
for i := 0; i < 10; i++ {
|
||||
for i := range 10 {
|
||||
dataLen := 150 + rand.Intn(150)
|
||||
data := make([]byte, dataLen)
|
||||
_, err := io.ReadFull(rand.Reader, data[100:])
|
||||
@@ -716,7 +716,7 @@ func TestIndexIDString(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func closeAndWait(c interface{}, closers ...io.Closer) {
|
||||
func closeAndWait(c any, closers ...io.Closer) {
|
||||
for _, closer := range closers {
|
||||
closer.Close()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user