mirror of
https://gitee.com/johng/gf.git
synced 2024-12-05 13:48:09 +08:00
22 lines
310 B
Go
22 lines
310 B
Go
package main
|
|
|
|
import (
|
|
"gitee.com/johng/gf/g/net/gsession"
|
|
"fmt"
|
|
)
|
|
|
|
|
|
func main() {
|
|
id := 0
|
|
for i := 0; i < 10; i++ {
|
|
s := gsession.Get("1")
|
|
if r := s.Get("id"); r != nil {
|
|
id = r.(int)
|
|
}
|
|
id++
|
|
s.Set("id", id)
|
|
|
|
fmt.Println(id)
|
|
}
|
|
|
|
} |