MCPcopy
hub / github.com/gin-gonic/gin / hasRequestContext

Method hasRequestContext

context.go:1434–1438  ·  view source on GitHub ↗

************************************/ ***** GOLANG.ORG/X/NET/CONTEXT *****/ ************************************/ hasRequestContext returns whether c.Request has Context and fallback.

()

Source from the content-addressed store, hash-verified

1432
1433// hasRequestContext returns whether c.Request has Context and fallback.
1434func (c *Context) hasRequestContext() bool {
1435 hasFallback := c.engine != nil && c.engine.ContextWithFallback
1436 hasRequestContext := c.Request != nil && c.Request.Context() != nil
1437 return hasFallback && hasRequestContext
1438}
1439
1440// Deadline returns that there is no deadline (ok==false) when c.Request has no Context.
1441func (c *Context) Deadline() (deadline time.Time, ok bool) {

Callers 5

DeadlineMethod · 0.95
DoneMethod · 0.95
ErrMethod · 0.95
ValueMethod · 0.95
TestHasRequestContextFunction · 0.80

Calls

no outgoing calls

Tested by 1

TestHasRequestContextFunction · 0.64