git » gofer » commit ceaa472

trace: use a separate context key type to prevent collisions

author Alberto Bertogli
2020-04-29 21:49:47 UTC
committer Alberto Bertogli
2020-04-29 21:49:47 UTC
parent 3af5b1e4976e836ad999c934a6e59b4eb75567ce

trace: use a separate context key type to prevent collisions

trace/trace.go +3 -1

diff --git a/trace/trace.go b/trace/trace.go
index 8699778..709dd64 100644
--- a/trace/trace.go
+++ b/trace/trace.go
@@ -12,7 +12,9 @@ import (
 	nettrace "golang.org/x/net/trace"
 )
 
-const contextKey = "blitiri.com.ar/go/gofer/trace.Trace"
+type key string
+
+const contextKey key = "blitiri.com.ar/go/gofer/trace.Trace"
 
 // A Trace represents an active request.
 type Trace struct {