摘要: 1 并发过高导致程序崩溃 我们首先看一个非常简单的例子: func main() { var wg sync.WaitGroup for i := 0; i < math.MaxInt32; i++ { wg.Add(1) go func(i int) { defer wg.Done() fmt.P 阅读全文
posted @ 2021-08-23 15:44 plpeng 阅读(495) 评论(0) 推荐(0)
摘要: 1 空结构体占用空间么 在 Go 语言中,我们可以使用 unsafe.Sizeof 计算出一个数据类型实例需要占用的字节数。 package main import ( "fmt" "unsafe" ) func main() { fmt.Println(unsafe.Sizeof(struct{} 阅读全文
posted @ 2021-08-23 15:27 plpeng 阅读(404) 评论(0) 推荐(0)
摘要: 1.发现Git拉代码用账号密码报错,错误如下 remote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead. remote: 阅读全文
posted @ 2021-08-23 11:59 plpeng 阅读(9632) 评论(1) 推荐(4)