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:
ryan
2026-08-16 17:47:09 +08:00
parent ce28f63659
commit 288b74d104
9 changed files with 16 additions and 18 deletions
+2 -2
View File
@@ -47,7 +47,7 @@ func (r *LogRingBuffer) Write(p []byte) (int, error) {
data := string(p)
start := 0
for i := 0; i < len(data); i++ {
for i := range len(data) {
if data[i] == '\n' {
line := data[start:i]
start = i + 1
@@ -114,7 +114,7 @@ func (r *LogRingBuffer) Query(cursor int, limit int) ([]LogEntry, bool) {
// 将 ring buffer 中的有效条目按顺序收集
ordered := make([]LogEntry, 0, r.count)
for i := 0; i < r.count; i++ {
for i := range r.count {
pos := (oldestPos + i) % r.cap
ordered = append(ordered, r.entries[pos])
}