2021年1月18日

删除Rancher节点的正确姿势

摘要: 在Rancher上疏散该节点 删除节点 登录该节点宿主机,删除rancher相关容器 docker rm -f -v $(docker ps -aq) 删除该节点的所有volume docker volume rm $(docker volume ls) 最后删除/var/lib/rancher文件 阅读全文

posted @ 2021-01-18 15:24 ExplorerMan 阅读(1294) 评论(0) 推荐(0)

go深度拷贝json版

摘要: go中的深度拷贝方式 1.使用json的序列化和反序列化 通过将原来的结构序列化成byte数组,然后将byte数组反序列化到 目标结构的方式来进行深度拷贝。相关代码如下: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 2 阅读全文

posted @ 2021-01-18 14:06 ExplorerMan 阅读(235) 评论(0) 推荐(0)

go深度拷贝gob版

摘要: 通过gob的序列化和反序列化进行深度拷贝 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 阅读全文

posted @ 2021-01-18 11:57 ExplorerMan 阅读(174) 评论(0) 推荐(0)

go深度拷贝reflect版

摘要: 使用 reflecting 和 gob 两种方式,性能比较结果: Deep copy with reflecting is 10x faster than gob and it will save more memory. reflecting 使用库 https://github.com/moha 阅读全文

posted @ 2021-01-18 11:56 ExplorerMan 阅读(188) 评论(0) 推荐(0)

深入理解Go Context

摘要: 目录 emptyCtx类型 cancelCtx类型 timerCtx类型 valueCtx类型 在Go语言并发编程中,用一个goroutine来处理一个任务,而它又会创建多个goroutine来负责不同子任务的场景非常常见。如下图 这些场景中,往往会需要在API边界之间以及过程之间传递截止时间、取消 阅读全文

posted @ 2021-01-18 11:24 ExplorerMan 阅读(187) 评论(0) 推荐(0)

导航