diff options
author | Christopher Speller <crspeller@gmail.com> | 2017-04-24 20:11:36 -0400 |
---|---|---|
committer | Joram Wilander <jwawilander@gmail.com> | 2017-04-24 20:11:36 -0400 |
commit | f5437632f486b7d0a0a181c58f113c86d032b02c (patch) | |
tree | 407388e3003a210a89f4b2128d7ad656f8b79d26 /vendor/golang.org/x/net/trace | |
parent | 7f68a60f8c228d5604e0566bf84cabb145d16c37 (diff) | |
download | chat-f5437632f486b7d0a0a181c58f113c86d032b02c.tar.gz chat-f5437632f486b7d0a0a181c58f113c86d032b02c.tar.bz2 chat-f5437632f486b7d0a0a181c58f113c86d032b02c.zip |
Upgrading server dependancies (#6215)
Diffstat (limited to 'vendor/golang.org/x/net/trace')
-rw-r--r-- | vendor/golang.org/x/net/trace/trace.go | 13 | ||||
-rw-r--r-- | vendor/golang.org/x/net/trace/trace_go16.go | 21 | ||||
-rw-r--r-- | vendor/golang.org/x/net/trace/trace_go17.go | 21 |
3 files changed, 42 insertions, 13 deletions
diff --git a/vendor/golang.org/x/net/trace/trace.go b/vendor/golang.org/x/net/trace/trace.go index 64f56a373..3d9b64611 100644 --- a/vendor/golang.org/x/net/trace/trace.go +++ b/vendor/golang.org/x/net/trace/trace.go @@ -77,7 +77,6 @@ import ( "sync/atomic" "time" - "golang.org/x/net/context" "golang.org/x/net/internal/timeseries" ) @@ -271,18 +270,6 @@ type contextKeyT string var contextKey = contextKeyT("golang.org/x/net/trace.Trace") -// NewContext returns a copy of the parent context -// and associates it with a Trace. -func NewContext(ctx context.Context, tr Trace) context.Context { - return context.WithValue(ctx, contextKey, tr) -} - -// FromContext returns the Trace bound to the context, if any. -func FromContext(ctx context.Context) (tr Trace, ok bool) { - tr, ok = ctx.Value(contextKey).(Trace) - return -} - // Trace represents an active request. type Trace interface { // LazyLog adds x to the event log. It will be evaluated each time the diff --git a/vendor/golang.org/x/net/trace/trace_go16.go b/vendor/golang.org/x/net/trace/trace_go16.go new file mode 100644 index 000000000..d60819118 --- /dev/null +++ b/vendor/golang.org/x/net/trace/trace_go16.go @@ -0,0 +1,21 @@ +// Copyright 2017 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build !go1.7 + +package trace + +import "golang.org/x/net/context" + +// NewContext returns a copy of the parent context +// and associates it with a Trace. +func NewContext(ctx context.Context, tr Trace) context.Context { + return context.WithValue(ctx, contextKey, tr) +} + +// FromContext returns the Trace bound to the context, if any. +func FromContext(ctx context.Context) (tr Trace, ok bool) { + tr, ok = ctx.Value(contextKey).(Trace) + return +} diff --git a/vendor/golang.org/x/net/trace/trace_go17.go b/vendor/golang.org/x/net/trace/trace_go17.go new file mode 100644 index 000000000..df6e1fba7 --- /dev/null +++ b/vendor/golang.org/x/net/trace/trace_go17.go @@ -0,0 +1,21 @@ +// Copyright 2017 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build go1.7 + +package trace + +import "context" + +// NewContext returns a copy of the parent context +// and associates it with a Trace. +func NewContext(ctx context.Context, tr Trace) context.Context { + return context.WithValue(ctx, contextKey, tr) +} + +// FromContext returns the Trace bound to the context, if any. +func FromContext(ctx context.Context) (tr Trace, ok bool) { + tr, ok = ctx.Value(contextKey).(Trace) + return +} |