Skip to content

Commit 9f9bf6c

Browse files
committed
Fix some Go linting errors
1 parent f1170f9 commit 9f9bf6c

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

commands/args.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ func (a *Args) GetParam(i int) string {
104104

105105
func (a *Args) FirstParam() string {
106106
if a.ParamsSize() == 0 {
107-
panic(fmt.Sprintf("Index 0 is out of bound"))
107+
panic("Index 0 is out of bound")
108108
}
109109

110110
return a.Params[0]

commands/clone.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,13 @@ func transformCloneArgs(args *Args) {
7676
p.Parse(args.Params)
7777

7878
nameWithOwnerRegexp := regexp.MustCompile(NameWithOwnerRe)
79-
for _, i := range p.PositionalIndices {
79+
if len(p.PositionalIndices) > 0 {
80+
i := p.PositionalIndices[0]
8081
a := args.Params[i]
8182
if nameWithOwnerRegexp.MatchString(a) && !isCloneable(a) {
8283
url := getCloneURL(a, isSSH, args.Command != "submodule")
8384
args.ReplaceParam(i, url)
8485
}
85-
break
8686
}
8787
}
8888

ui/format.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,7 @@ const (
196196
type truncingMethod int
197197

198198
const (
199-
noTrunc truncingMethod = iota
200-
truncLeft
199+
truncLeft truncingMethod = iota
201200
truncRight
202201
truncMiddle
203202
)

0 commit comments

Comments
 (0)