mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-02 14:56:38 +08:00
intrange 3→0 + modernize 5→3:for i:=0;i<len/N;i++ → range len/N(8 处);time.Time 字段 omitempty→omitzero(wire 输出一致);SplitSeq;min() 简化。刻意保留 lark.go omitzero(会改变 wire 行为)。
Result: {"status":"keep","total_issues":33,"golint_canonicalheader":0,"golint_errname":1,"golint_errorlint":12,"golint_forcetypeassert":3,"golint_gosec":0,"golint_intrange":0,"golint_modernize":3,"golint_nilnil":3,"golint_perfsprint":0,"golint_prealloc":3,"golint_recvcheck":7,"golint_usestdlibvars":0,"golint_wastedassign":0,"golint_total":32,"eslint_problems":1,"eslint_errors":0,"eslint_warnings":1,"tsc_errors":0,"measure_s":45}
This commit is contained in:
@@ -4,7 +4,7 @@ import "strconv"
|
||||
|
||||
func compareVersionNumbers(left, right VersionInfo) int {
|
||||
maxLen := max(len(right.Numbers), len(left.Numbers))
|
||||
for index := 0; index < maxLen; index++ {
|
||||
for index := range maxLen {
|
||||
leftValue := 0
|
||||
rightValue := 0
|
||||
if index < len(left.Numbers) {
|
||||
@@ -35,7 +35,7 @@ func compareGitDescribeDistance(left, right VersionInfo) int {
|
||||
|
||||
func compareGitDescribeTails(left, right VersionInfo) int {
|
||||
maxLen := max(len(right.GitDescribeTail), len(left.GitDescribeTail))
|
||||
for index := 0; index < maxLen; index++ {
|
||||
for index := range maxLen {
|
||||
if index >= len(left.GitDescribeTail) {
|
||||
return -1
|
||||
}
|
||||
@@ -64,7 +64,7 @@ func comparePrereleaseIdentifiers(left, right VersionInfo) int {
|
||||
}
|
||||
|
||||
maxLen := max(len(right.Prerelease), len(left.Prerelease))
|
||||
for index := 0; index < maxLen; index++ {
|
||||
for index := range maxLen {
|
||||
if index >= len(left.Prerelease) {
|
||||
return -1
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user