mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-30 06:38:37 -04:00 
			
		
		
		
	go1.16 (#14783)
This commit is contained in:
		
							
								
								
									
										27
									
								
								vendor/github.com/go-chi/chi/context.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										27
									
								
								vendor/github.com/go-chi/chi/context.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -4,7 +4,6 @@ import ( | ||||
| 	"context" | ||||
| 	"net/http" | ||||
| 	"strings" | ||||
| 	"time" | ||||
| ) | ||||
|  | ||||
| // URLParam returns the url parameter from a http.Request object. | ||||
| @@ -146,32 +145,6 @@ func (s *RouteParams) Add(key, value string) { | ||||
| 	s.Values = append(s.Values, value) | ||||
| } | ||||
|  | ||||
| // directContext provides direct access to the routing *Context object, | ||||
| // while implementing the context.Context interface, thereby allowing | ||||
| // us to saving 1 allocation during routing. | ||||
| type directContext Context | ||||
|  | ||||
| var _ context.Context = (*directContext)(nil) | ||||
|  | ||||
| func (d *directContext) Deadline() (deadline time.Time, ok bool) { | ||||
| 	return d.parentCtx.Deadline() | ||||
| } | ||||
|  | ||||
| func (d *directContext) Done() <-chan struct{} { | ||||
| 	return d.parentCtx.Done() | ||||
| } | ||||
|  | ||||
| func (d *directContext) Err() error { | ||||
| 	return d.parentCtx.Err() | ||||
| } | ||||
|  | ||||
| func (d *directContext) Value(key interface{}) interface{} { | ||||
| 	if key == RouteCtxKey { | ||||
| 		return (*Context)(d) | ||||
| 	} | ||||
| 	return d.parentCtx.Value(key) | ||||
| } | ||||
|  | ||||
| // contextKey is a value for use with context.WithValue. It's used as | ||||
| // a pointer so it fits in an interface{} without allocation. This technique | ||||
| // for defining context keys was copied from Go 1.7's new use of context in net/http. | ||||
|   | ||||
		Reference in New Issue
	
	Block a user