-
-
Notifications
You must be signed in to change notification settings - Fork 19
Closed
Description
What’s the problem?
slog-gin currently stores its per-request ID under a private key:
const requestIDCtx = "slog-gin.request-id"
Because it’s unexported, anyone who wants to pull that ID out of a plain context.Context must hard-code the string literal, leading to brittle, “stringly-typed” code.
Why can’t I just use GetRequestID?
func GetRequestID(c *gin.Context) string
That helper only works with a Gin *gin.Context. In many architectures—where inner layers deal only in context.Context—you can’t import or depend on Gin types.
Happy to open a PR if this sounds reasonable!
Metadata
Metadata
Assignees
Labels
No labels