зеркало из https://github.com/mislav/hub.git
Fix some Go linting errors
This commit is contained in:
Родитель
f1170f982c
Коммит
9f9bf6c463
|
@ -104,7 +104,7 @@ func (a *Args) GetParam(i int) string {
|
||||||
|
|
||||||
func (a *Args) FirstParam() string {
|
func (a *Args) FirstParam() string {
|
||||||
if a.ParamsSize() == 0 {
|
if a.ParamsSize() == 0 {
|
||||||
panic(fmt.Sprintf("Index 0 is out of bound"))
|
panic("Index 0 is out of bound")
|
||||||
}
|
}
|
||||||
|
|
||||||
return a.Params[0]
|
return a.Params[0]
|
||||||
|
|
|
@ -76,13 +76,13 @@ func transformCloneArgs(args *Args) {
|
||||||
p.Parse(args.Params)
|
p.Parse(args.Params)
|
||||||
|
|
||||||
nameWithOwnerRegexp := regexp.MustCompile(NameWithOwnerRe)
|
nameWithOwnerRegexp := regexp.MustCompile(NameWithOwnerRe)
|
||||||
for _, i := range p.PositionalIndices {
|
if len(p.PositionalIndices) > 0 {
|
||||||
|
i := p.PositionalIndices[0]
|
||||||
a := args.Params[i]
|
a := args.Params[i]
|
||||||
if nameWithOwnerRegexp.MatchString(a) && !isCloneable(a) {
|
if nameWithOwnerRegexp.MatchString(a) && !isCloneable(a) {
|
||||||
url := getCloneURL(a, isSSH, args.Command != "submodule")
|
url := getCloneURL(a, isSSH, args.Command != "submodule")
|
||||||
args.ReplaceParam(i, url)
|
args.ReplaceParam(i, url)
|
||||||
}
|
}
|
||||||
break
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -196,8 +196,7 @@ const (
|
||||||
type truncingMethod int
|
type truncingMethod int
|
||||||
|
|
||||||
const (
|
const (
|
||||||
noTrunc truncingMethod = iota
|
truncLeft truncingMethod = iota
|
||||||
truncLeft
|
|
||||||
truncRight
|
truncRight
|
||||||
truncMiddle
|
truncMiddle
|
||||||
)
|
)
|
||||||
|
|
Загрузка…
Ссылка в новой задаче