Add AGENTS.md, simplify code, 2 fixes in log package, 3 bugs fixed.

- Add AGENTS.md for vibecoding ai data.
- Remove github.com/pkg/errors dependency
- writeWithContext — remove goroutine overhead, just check context before fn
- copyWithContext — remove unnecessary panic recovery
- Remove panic recovery tests (TestWriteWithContextPanic, TestCopyWithContextPanic, panicReader)
- Error, Warn, Info, Debug, Fatal — accept ...any instead of string (enables log.Error(err))
- Close — don't panic if Log is nil, don't close stderr
- Add unit tests (internal/log/main_test.go)
- getClientIP — trim spaces from X-Forwarded-For, use net.SplitHostPort for IPv6
- isExcluded — normalize paths to forward slashes for cross-platform regex matching
- writeWithContext godoc — fix stale comment about panic recovery
- internal/log/main_test.go — log package tests (19 tests)
This commit is contained in:
eleksir
2026-03-27 01:24:32 +03:00
parent 0bea45b770
commit 16ae887196
11 changed files with 681 additions and 98 deletions

5
go.mod
View File

@@ -2,7 +2,4 @@ module backer
go 1.25
require (
github.com/hjson/hjson-go v3.3.0+incompatible
github.com/pkg/errors v0.9.1
)
require github.com/hjson/hjson-go v3.3.0+incompatible