-
Notifications
You must be signed in to change notification settings - Fork 1
/
0001-Convert-int-to-string-using-strconv.Itoa.patch
61 lines (53 loc) · 1.99 KB
/
0001-Convert-int-to-string-using-strconv.Itoa.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
From 80c8dfe084f44eb660aa1af5b5d49e27e1dfd11e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Robert-Andr=C3=A9=20Mauchin?= <[email protected]>
Date: Mon, 10 Aug 2020 15:09:08 +0200
Subject: [PATCH] Convert int to string using strconv.Itoa
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
See https://github.com/golang/go/issues/32479
Signed-off-by: Robert-André Mauchin <[email protected]>
---
etcdserver/api/v2store/store_test.go | 3 ++-
wal/wal_test.go | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/etcdserver/api/v2store/store_test.go b/etcdserver/api/v2store/store_test.go
index 76ec02d4e..0b1e9dad1 100644
--- a/etcdserver/api/v2store/store_test.go
+++ b/etcdserver/api/v2store/store_test.go
@@ -15,6 +15,7 @@
package v2store_test
import (
+ "strconv"
"testing"
"time"
@@ -844,7 +845,7 @@ func TestStoreWatchSlowConsumer(t *testing.T) {
s.Watch("/foo", true, true, 0) // stream must be true
// Fill watch channel with 100 events
for i := 1; i <= 100; i++ {
- s.Set("/foo", false, string(i), v2store.TTLOptionSet{ExpireTime: v2store.Permanent}) // ok
+ s.Set("/foo", false, strconv.Itoa(i), v2store.TTLOptionSet{ExpireTime: v2store.Permanent}) // ok
}
// testutil.AssertEqual(t, s.WatcherHub.count, int64(1))
s.Set("/foo", false, "101", v2store.TTLOptionSet{ExpireTime: v2store.Permanent}) // ok
diff --git a/wal/wal_test.go b/wal/wal_test.go
index f457dbf3c..8e8a252a0 100644
--- a/wal/wal_test.go
+++ b/wal/wal_test.go
@@ -25,6 +25,7 @@ import (
"path/filepath"
"reflect"
"regexp"
+ "strconv"
"testing"
"go.etcd.io/etcd/pkg/fileutil"
@@ -239,7 +240,7 @@ func TestVerify(t *testing.T) {
// make 5 separate files
for i := 0; i < 5; i++ {
- es := []raftpb.Entry{{Index: uint64(i), Data: []byte("waldata" + string(i+1))}}
+ es := []raftpb.Entry{{Index: uint64(i), Data: []byte("waldata" + strconv.Itoa(i+1))}}
if err = w.Save(raftpb.HardState{}, es); err != nil {
t.Fatal(err)
}
--
2.26.2