Skip to content

Commit e27c1d6

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

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

Diff for: .travis.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,12 @@ os:
44
language: go
55

66
go:
7-
- 1.11.x
7+
- 1.15.x
88

99
env:
1010
global:
1111
- GOTFLAGS="-race"
1212
matrix:
13-
- BUILD_DEPTYPE=gx
1413
- BUILD_DEPTYPE=gomod
1514

1615

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)