File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -83,9 +83,9 @@ func InheritContext(ic *ImmutableContext) {
83
83
}
84
84
}
85
85
86
- // NewLocalStorage create and return an new LocalStorage instance.
86
+ // NewLocalStorage create and return a new LocalStorage instance.
87
87
func NewLocalStorage () LocalStorage {
88
- return new ( storage )
88
+ return newStorage ( )
89
89
}
90
90
91
91
// Goid get the unique goid of the current routine.
Original file line number Diff line number Diff line change @@ -18,6 +18,15 @@ func TestGoStorage(t *testing.T) {
18
18
assert .True (t , v != nil && v .(string ) == variable )
19
19
})
20
20
nap ()
21
+
22
+ stg2 := NewLocalStorage ()
23
+ stg2 .Set (int64 (100 ))
24
+
25
+ v := stg .Get ()
26
+ assert .True (t , v != nil && v .(string ) == variable )
27
+
28
+ v = stg2 .Get ()
29
+ assert .True (t , v != nil && v .(int64 ) == 100 )
21
30
}
22
31
23
32
// BenchmarkGoid-12 1000000000 1.036 ns/op 0 B/op 0 allocs/op
You can’t perform that action at this time.
0 commit comments