摘要: 首先我们简单的来看一个例子,如下:(学好这个例子,我们就可以说完全掌握住context了,并且能重构一个context func main() { ctx, cancel := context.WithCancel(context.Background()) ctxV := context.With 阅读全文
posted @ 2023-04-07 15:39 望权栈 阅读(10) 评论(0) 推荐(0) 编辑
摘要: 代码例子如下: type Student struct { Name string `json:"name"` Age int `json:"age"` } func main() { stu := Student{ Name: "张三", Age: 21, } buf := bytes.NewBu 阅读全文
posted @ 2023-04-07 10:42 望权栈 阅读(59) 评论(0) 推荐(0) 编辑