mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-03-17 20:47:50 +02:00
fix: lint issue
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
This commit is contained in:
parent
c67b8d0ba7
commit
2758964617
@ -140,19 +140,17 @@ func longestCommonPrefix(strs []string) string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// copied from nfpm
|
// copied from nfpm
|
||||||
//
|
|
||||||
//nolint:revive // redefines-builtin-id
|
|
||||||
func strlcp(a, b string) string {
|
func strlcp(a, b string) string {
|
||||||
var min int
|
var minlen int
|
||||||
if len(a) > len(b) {
|
if len(a) > len(b) {
|
||||||
min = len(b)
|
minlen = len(b)
|
||||||
} else {
|
} else {
|
||||||
min = len(a)
|
minlen = len(a)
|
||||||
}
|
}
|
||||||
for i := 0; i < min; i++ {
|
for i := 0; i < minlen; i++ {
|
||||||
if a[i] != b[i] {
|
if a[i] != b[i] {
|
||||||
return a[0:i]
|
return a[0:i]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return a[0:min]
|
return a[0:minlen]
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user