Skip to content

Commit 6b8c720

Browse files
use a struct as a key for the context
1 parent 87aa106 commit 6b8c720

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Diff for: context.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ package metrics
22

33
import "context"
44

5-
const CtxScopeKey = "ipfs.metrics.scope"
5+
type ctxScopeKey struct {}
6+
7+
var CtxScopeKey = ctxScopeKey{}
68

79
func CtxGetScope(ctx context.Context) string {
810
s := ctx.Value(CtxScopeKey)

0 commit comments

Comments
 (0)