From 5f77173a00545065319d2cc9407dec0dc896ea03 Mon Sep 17 00:00:00 2001 From: vinllen Date: Sun, 26 May 2019 11:04:06 +0800 Subject: [PATCH 1/2] polish README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index aabf1fe..b405d9b 100644 --- a/README.md +++ b/README.md @@ -67,7 +67,7 @@ User can use `-version` to print the version. # Usage --- -You can use the binary in the release package.
+You can directly download the binary in the [release package](https://github.com/alibaba/RedisShake/releases).
You can also build redis-shake yourself according to the following steps, the `go` and `govendor` must be installed before compile: * git clone https://github.com/alibaba/RedisShake.git * cd RedisShake From b85e6fd7bc2289d1c04103e03aff007640cad7b6 Mon Sep 17 00:00:00 2001 From: Zheng Dayu Date: Mon, 27 May 2019 16:55:08 +0800 Subject: [PATCH 2/2] fix GetTotalLink by using SourceAddressList instead of SourceAddress --- src/redis-shake/common/common.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/redis-shake/common/common.go b/src/redis-shake/common/common.go index bf0a607..2e0dfb7 100644 --- a/src/redis-shake/common/common.go +++ b/src/redis-shake/common/common.go @@ -1,10 +1,10 @@ package utils import ( - "net" + "bytes" "fmt" + "net" "strings" - "bytes" "pkg/libs/bytesize" "redis-shake/configure" @@ -26,7 +26,7 @@ const ( TencentCluster = "tencent_cluster" AliyunCluster = "aliyun_cluster" - UCloudCluster = "ucloud_cluster" + UCloudCluster = "ucloud_cluster" ) var ( @@ -56,7 +56,7 @@ func ReadRESPEnd(c net.Conn) (string, error) { func RemoveRESPEnd(input string) string { length := len(input) if length >= 2 { - return input[: length - 2] + return input[:length-2] } return input } @@ -75,8 +75,8 @@ func ParseInfo(content []byte) map[string]string { } func GetTotalLink() int { - if len(conf.Options.SourceAddress) != 0 { - return len(conf.Options.SourceAddress) + if len(conf.Options.SourceAddressList) != 0 { + return len(conf.Options.SourceAddressList) } else { return len(conf.Options.RdbInput) } @@ -87,4 +87,4 @@ func PickTargetRoundRobin(n int) int { TargetRoundRobin = (TargetRoundRobin + 1) % n }() return TargetRoundRobin -} \ No newline at end of file +}