摘要: #环境配置 #内核配置 #基本组件安装 #高可用组件安装 #kubeadm集群初始化 阅读全文
posted @ 2021-12-07 14:06 wangzhilei 阅读(25) 评论(0) 推荐(0)
摘要: 基本思想: Parametric Polymorphism(形式)参数多态 #基本语法 package main import "fmt" func printSlice[T any](s []T){ for _,v:=range s{ fmt.Printf("%v",v) } fmt.Print( 阅读全文
posted @ 2021-12-07 13:56 wangzhilei 阅读(128) 评论(0) 推荐(0)
摘要: 轻量级"线程" 非抢占式多任务处理,由协程主动交出控制权 func main() { for i := 0; i < 1000; i++ { go func(i int) { //没有主动交出控制权 for { fmt.Printf("Hello from "+ "goroutine %d\n", 阅读全文
posted @ 2021-11-15 15:34 wangzhilei 阅读(110) 评论(0) 推荐(0)
摘要: #MAP 非thread-safe ##数据结构 ┌─────────────┐ │ hmap │ ├─────────────┴──────────────────┐ ┌───────────────┐ ┌─────────┐ ┌─────────┐ │ count int │ │ │ ┌──── 阅读全文
posted @ 2021-10-15 15:47 wangzhilei 阅读(94) 评论(0) 推荐(0)
摘要: #数据结构 // runtime/slice.go type slice struct { array unsafe.Pointer // 元素指针 len int // 长度 cap int // 容量 } **array:**指向底层数组的指针 **len:**是slice的长度,当前数据成员数 阅读全文
posted @ 2021-10-12 21:45 wangzhilei 阅读(529) 评论(0) 推荐(0)
摘要: #UTF-8编译 | 编号 | 编码模板 | | | | | [0,127] | 0??????? | | [128,2047] | 110????? 10?????? | | [2048,65535] | 1110???? 10?????? 10?????? | fmp.Printf("%c\n" 阅读全文
posted @ 2021-10-12 20:57 wangzhilei 阅读(21) 评论(0) 推荐(0)
摘要: #创建集合 use person //创建数据库或进入数据库 db.createCollection(table_name) #主键 插入数据时会自动生成主键,保证每条数据唯一性 生成对象主键 > ObjectId() ObjectId("6163fb2ffaca91ed57d6c202") 2.查 阅读全文
posted @ 2021-10-11 17:44 wangzhilei 阅读(124) 评论(0) 推荐(0)
摘要: 客户端 GET POST form表单 json body二进制流 上传文件 PUT DELETE HEAD 重定向 Client Request Response Cookie CookieJar 文件下载与进度 客户端超时设置 http代理 header 服务端 #客户端 const ( Met 阅读全文
posted @ 2021-10-10 19:37 wangzhilei 阅读(218) 评论(0) 推荐(0)
摘要: 并发模型 并发与并行 什么是CSP 什么是channel channel原理 数据结构 创建 接收 发送 关闭 channel进阶 发送和接收元素的本质 资源泄漏 [happened before](#happened before) [如何优雅地关闭 channel](#如何优雅地关闭 chann 阅读全文
posted @ 2021-10-05 10:14 wangzhilei 阅读(632) 评论(0) 推荐(0)
摘要: 什么是context context底层原理 接口 Context canceler 结构体 emptyCtx cancelCtx timeCtx valueCtx 传递共享数据 [超时取消 goroutine](#超时取消 goroutine) 设置截止时间,超时触发 调用cancel,关闭gor 阅读全文
posted @ 2021-10-04 10:03 wangzhilei 阅读(1015) 评论(0) 推荐(0)