提交 f18223fb 编写于 作者: X Xinlong-Chen 提交者: SiKu

[fix] tools-v2: fix robust string

Signed-off-by: NXinlong-Chen <xl_chen@zju.edu.cn>
上级 a14bcd3e
......@@ -514,7 +514,12 @@ func GetBsAddrSlice(cmd *cobra.Command, addrType string) ([]string, *cmderror.Cm
} else {
addrsStr = viper.GetString(BSFLAG2VIPER[addrType])
}
addrslice := strings.Split(addrsStr, ",")
for i, addr := range addrslice {
addrslice[i] = strings.TrimSpace(addr)
}
for _, addr := range addrslice {
if !IsValidAddr(addr) {
err := cmderror.ErrGetAddr()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册