refactor: extract path logic to path.go and run go fmt on codebase

This commit is contained in:
duorameng
2026-05-22 14:52:51 +08:00
parent b6fd889661
commit 4c283a60d5
55 changed files with 409 additions and 420 deletions
+3 -3
View File
@@ -23,7 +23,7 @@ func TestTinyLog_UTF8Splitting(t *testing.T) {
}
_, _ = tl.Write(part2)
// Currently it should collect both parts but still no newline,
// Currently it should collect both parts but still no newline,
// so remainder should be 5 bytes.
if len(tl.remainder) != 5 {
t.Errorf("Expected remainder len 5, got %d", len(tl.remainder))
@@ -58,7 +58,7 @@ func TestTinyLog_CarriageReturn(t *testing.T) {
if err != nil {
t.Fatalf("ReadLastLines failed: %v", err)
}
// Should contain both progress lines (or at least be split correctly)
if !bytes.Contains(data, []byte("progress: 50%")) {
t.Errorf("Expected output to contain 'progress: 50%%', got %q", data)
@@ -94,7 +94,7 @@ func TestTinyLog_LongLineCut(t *testing.T) {
// Our logic finds the last safe boundary before maxLogBufferLen.
// RuneStart(E4) at maxLogBufferLen-1 is true. FullRune(E4 at maxLogBufferLen-1 in payload[:maxLogBufferLen]) is false.
// So lastSafe should be maxLogBufferLen-1.
// The first maxLogBufferLen-1 bytes (all 'A') should be processed.
// The "你" should be in remainder.