We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dd1ed0b commit 96426d0Copy full SHA for 96426d0
README.md
@@ -75,29 +75,6 @@ func main() {
75
foo := x.(*MyStruct)
76
// ...
77
}
78
-
79
- // If you store a reference type like a pointer, slice, map or channel, you
80
- // do not need to run Set if you modify the underlying data. The cached
81
- // reference points to the same memory, so if you modify a struct whose
82
- // pointer you've stored in the cache, retrieving that pointer with Get will
83
- // point you to the same data:
84
- foo := &MyStruct{Num: 1}
85
- c.Set("foo", foo, cache.DefaultExpiration)
86
- // ...
87
- x, _ := c.Get("foo")
88
- foo := x.(*MyStruct)
89
- fmt.Println(foo.Num)
90
91
- foo.Num++
92
93
94
95
- foo.Println(foo.Num)
96
97
- // will print:
98
- // 1
99
- // 2
100
101
102
```
103
0 commit comments