1 Star 0 Fork 24

src-oepkgs-oE-rv/etcd

forked from src-openEuler/etcd 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0001-Convert-int-to-string-using-strconv.Itoa.patch 1.99 KB
一键复制 编辑 原始数据 按行查看 历史
jiangxinyu 提交于 2021-01-27 15:16 . Update to 3.4.14
From 80c8dfe084f44eb660aa1af5b5d49e27e1dfd11e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Robert-Andr=C3=A9=20Mauchin?= <zebob.m@gmail.com>
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 <zebob.m@gmail.com>
---
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
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-oepkgs-oe-rv/etcd.git
git@gitee.com:src-oepkgs-oe-rv/etcd.git
src-oepkgs-oe-rv
etcd
etcd
master

搜索帮助