From: Sergey Matveev Date: Tue, 21 Jan 2025 08:55:10 +0000 (+0300) Subject: go fmt X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=ef19ca9e0ac9b84a69c67028a508d543c14b41585dc649ab3b2fbb7082a979f5;p=keks.git go fmt --- diff --git a/go/blob_test.go b/go/blob_test.go index 18a61de..480f449 100644 --- a/go/blob_test.go +++ b/go/blob_test.go @@ -127,7 +127,7 @@ func TestEmpty(t *testing.T) { } func TestBlobSymmetric(t *testing.T) { - f := func(ChunkLen uint8, ChunkNum uint8) bool { + f := func(ChunkLen, ChunkNum uint8) bool { if uint16(ChunkLen)*uint16(ChunkNum) > 2000 { return true } @@ -203,4 +203,4 @@ func TestBlobThrowsWhenWrongTerminatorTag(t *testing.T) { if err != ErrBlobBadAtom { t.Errorf("expected ErrBlobBadChunkLen, got %s", err) } -} \ No newline at end of file +} diff --git a/go/generic_test.go b/go/generic_test.go index 3b04b30..2b42815 100644 --- a/go/generic_test.go +++ b/go/generic_test.go @@ -30,4 +30,4 @@ func TestLonelyEOC(t *testing.T) { if err != ErrUnexpectedEOC { t.Errorf("expected ErrUnexpectedEOC, got %v", err) } -} \ No newline at end of file +} diff --git a/go/int_test.go b/go/int_test.go index 104fe7a..cba00c7 100644 --- a/go/int_test.go +++ b/go/int_test.go @@ -245,6 +245,7 @@ func TestThrowsWhenNonBinInInt(t *testing.T) { t.Errorf("expected ErrBadInt, got %v", err) } } + func TestTemp(t *testing.T) { object, suc := big.NewInt(1).SetString("-400000000000000000090009090909090909000000000000", 10) t.Log(object) @@ -305,6 +306,7 @@ func TestUInt32Symmetric(t *testing.T) { t.Error(err) } } + func TestUInt16Symmetric(t *testing.T) { f := func(x uint16) bool { encoded, err := EncodeBuf(x, nil) @@ -333,6 +335,7 @@ func TestUInt16Symmetric(t *testing.T) { t.Error(err) } } + func TestUInt8Symmetric(t *testing.T) { f := func(x uint8) bool { encoded, err := EncodeBuf(x, nil) diff --git a/go/list_test.go b/go/list_test.go index e375538..31f75f2 100644 --- a/go/list_test.go +++ b/go/list_test.go @@ -58,7 +58,6 @@ func TestListIntSymmetric(t *testing.T) { } udecoded, success := decoded.([]any) if !success { - t.Errorf("failed to cast") } for i := range x { diff --git a/go/map_test.go b/go/map_test.go index 724a35e..409d56b 100644 --- a/go/map_test.go +++ b/go/map_test.go @@ -16,7 +16,6 @@ func TestEmptyMap(t *testing.T) { encoded, err := EncodeBuf(object, nil) if err != nil { t.Errorf("error during encode: %s", err) - } if !bytes.Equal(encoded, hexstring) { t.Errorf("expected hexstring %s, got %s", hex.EncodeToString(hexstring), hex.EncodeToString(encoded)) diff --git a/go/string_test.go b/go/string_test.go index 72a1803..3d4c9da 100644 --- a/go/string_test.go +++ b/go/string_test.go @@ -207,7 +207,7 @@ func RandStringBytes(n int) string { } func TestThrowsWhenStringTooLong(t *testing.T) { - f := func(x uint8, y uint8) bool { + f := func(x, y uint8) bool { if (y == x) || (y == 0) || (x == 0) { return true } diff --git a/go/tai_test.go b/go/tai_test.go index 5cbec37..a548b9f 100644 --- a/go/tai_test.go +++ b/go/tai_test.go @@ -165,7 +165,7 @@ func Test20241120(t *testing.T) { } func TestTaiSymmetric(t *testing.T) { - f := func(a int64, b int64) bool { + f := func(a, b int64) bool { x := time.Unix(a, b) if a > 1<<62-1 { return true