Skip to content

Commit

Permalink
fix: constants.go for all the const for contextKey
Browse files Browse the repository at this point in the history
  • Loading branch information
teilomillet committed Dec 22, 2024
1 parent 227314a commit 623f314
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
8 changes: 8 additions & 0 deletions server/middleware/constants.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package middleware

type contextKey string

const (
RequestIDKey contextKey = "request_id"
XTestTimeoutKey contextKey = "X-Test-Timeout"
)
5 changes: 0 additions & 5 deletions server/middleware/request_id.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@ import (
"github.com/google/uuid"
)

type contextKey string

// RequestIDKey is the key used to store the request ID in the context.
const RequestIDKey contextKey = "request_id"

// RequestID middleware adds a unique request ID to the context
// and sets it in the response header.
func RequestID(next http.Handler) http.Handler {
Expand Down

0 comments on commit 623f314

Please sign in to comment.