]> Cypherpunks.ru repositories - netstring.git/commitdiff
Explicit latest Go v2.4.1
authorSergey Matveev <stargrave@stargrave.org>
Tue, 27 Jun 2023 12:21:32 +0000 (15:21 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Tue, 27 Jun 2023 12:21:32 +0000 (15:21 +0300)
go.mod
ns_test.go

diff --git a/go.mod b/go.mod
index cdefced94c85cbb9566796cdd4efb33366d8a36e..b968fda901a019c7ec77ddb0107d22b32c8167df 100644 (file)
--- a/go.mod
+++ b/go.mod
@@ -1,3 +1,3 @@
 module go.cypherpunks.ru/netstring/v2
 
-go 1.12
+go 1.20
index 6ac07e42f662ce075532867fd06854c98d81c7bf..c3a138a1ad53926ff0303a989dc2a15a75e77eec 100644 (file)
@@ -36,7 +36,7 @@ func TestTrivial(t *testing.T) {
        if n, err := w.WriteChunk([]byte("barz")); err != nil || n != 7 {
                t.FailNow()
        }
-       if string(buf.Bytes()) != "3:foo,4:barz," {
+       if buf.String() != "3:foo,4:barz," {
                t.FailNow()
        }
        r := NewReader(&buf)
@@ -53,7 +53,7 @@ func TestTrivial(t *testing.T) {
        if n, err := r.Read(m); err != nil || n != 4 {
                t.FailNow()
        }
-       if bytes.Compare(m, []byte("barz")) != 0 {
+       if !bytes.Equal(m, []byte("barz")) {
                t.FailNow()
        }
 }
@@ -73,7 +73,7 @@ func TestSymmetric(t *testing.T) {
                                return false
                        }
                        got, err := io.ReadAll(r)
-                       if err != nil || bytes.Compare(got, data) != 0 {
+                       if err != nil || !bytes.Equal(got, data) {
                                return false
                        }
                }