提交 9f9bf6c4 编写于 作者: M Mislav Marohnić

Fix some Go linting errors

上级 f1170f98
......@@ -104,7 +104,7 @@ func (a *Args) GetParam(i int) string {
func (a *Args) FirstParam() string {
if a.ParamsSize() == 0 {
panic(fmt.Sprintf("Index 0 is out of bound"))
panic("Index 0 is out of bound")
}
return a.Params[0]
......
......@@ -76,13 +76,13 @@ func transformCloneArgs(args *Args) {
p.Parse(args.Params)
nameWithOwnerRegexp := regexp.MustCompile(NameWithOwnerRe)
for _, i := range p.PositionalIndices {
if len(p.PositionalIndices) > 0 {
i := p.PositionalIndices[0]
a := args.Params[i]
if nameWithOwnerRegexp.MatchString(a) && !isCloneable(a) {
url := getCloneURL(a, isSSH, args.Command != "submodule")
args.ReplaceParam(i, url)
}
break
}
}
......
......@@ -196,8 +196,7 @@ const (
type truncingMethod int
const (
noTrunc truncingMethod = iota
truncLeft
truncLeft truncingMethod = iota
truncRight
truncMiddle
)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册