GetGinRequestID retrieves the request ID from the Gin context.
(c *gin.Context)
| 49 | |
| 50 | // GetGinRequestID retrieves the request ID from the Gin context. |
| 51 | func GetGinRequestID(c *gin.Context) string { |
| 52 | if c == nil { |
| 53 | return "" |
| 54 | } |
| 55 | if id, exists := c.Get(ginRequestIDKey); exists { |
| 56 | if s, ok := id.(string); ok { |
| 57 | return s |
| 58 | } |
| 59 | } |
| 60 | return "" |
| 61 | } |