04 2023 档案
摘要:首先我们简单的来看一个例子,如下:(学好这个例子,我们就可以说完全掌握住context了,并且能重构一个context func main() { ctx, cancel := context.WithCancel(context.Background()) ctxV := context.With
阅读全文
摘要:代码例子如下: type Student struct { Name string `json:"name"` Age int `json:"age"` } func main() { stu := Student{ Name: "张三", Age: 21, } buf := bytes.NewBu
阅读全文