摘要://context.WithDeadline() // 指定一个终止时间 time //context.WithTimeout() // 自定义超时时间 time //context.WithValue() // 自定义一个键值对 取值 map[key]value //ctx,cancel:=con
阅读全文
文章分类 - golang
go语言
摘要://context.WithDeadline() // 指定一个终止时间 time //context.WithTimeout() // 自定义超时时间 time //context.WithValue() // 自定义一个键值对 取值 map[key]value //ctx,cancel:=con
阅读全文
摘要:// new make的区别 // new 主要是初始化基础类型 比如 string bool .... 以及自定义类型,返回的是指针 // make 主要是初始化slice/map/channel类型,返回的是对应的类型。
阅读全文
|