refactor: rename internal/log to internal/logging to avoid stdlib

shadowing

- refactor: rename `internal/log` → `internal/logging`, package `log` →
  `logging`
- refactor: update imports in `cmd/serve.go` and
  `internal/middleware/requestid.go`
This commit is contained in:
2026-07-06 00:11:06 +08:00
parent 3ad61244dc
commit 803f195af1
4 changed files with 6 additions and 6 deletions
+2 -2
View File
@@ -4,7 +4,7 @@ import (
"github.com/gin-gonic/gin"
"github.com/google/uuid"
mygolog "github.com/dhao2001/mygo/internal/log"
"github.com/dhao2001/mygo/internal/logging"
)
// RequestID returns a Gin middleware that ensures every request has a
@@ -19,7 +19,7 @@ func RequestID() gin.HandlerFunc {
}
// Inject into Go context for slog.*Context calls.
c.Request = c.Request.WithContext(mygolog.WithRequestID(c.Request.Context(), reqID))
c.Request = c.Request.WithContext(logging.WithRequestID(c.Request.Context(), reqID))
// Also set in Gin context for direct access.
c.Set("req_id", reqID)