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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user