Skip to content

Commit cd39124

Browse files
author
Jamie Tanna
committed
Lint: Ignore findings on string-based keys for Context
As it's probably a bit late to change this, in case it changes expected behaviour, via SA1029.
1 parent d05e8a1 commit cd39124

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

oapi_validate.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,12 +122,12 @@ func ValidateRequestFromContext(c *gin.Context, router routers.Router, options *
122122

123123
// Pass the gin context into the request validator, so that any callbacks
124124
// which it invokes make it available.
125-
requestContext := context.WithValue(context.Background(), GinContextKey, c)
125+
requestContext := context.WithValue(context.Background(), GinContextKey, c) //nolint:staticcheck
126126

127127
if options != nil {
128128
validationInput.Options = &options.Options
129129
validationInput.ParamDecoder = options.ParamDecoder
130-
requestContext = context.WithValue(requestContext, UserDataKey, options.UserData)
130+
requestContext = context.WithValue(requestContext, UserDataKey, options.UserData) //nolint:staticcheck
131131
}
132132

133133
err = openapi3filter.ValidateRequest(requestContext, validationInput)

0 commit comments

Comments
 (0)