- 博客(22)
- 收藏
- 关注
原创 go http包实现访问k8s api-server
3. 发起http请求,读取response.body获取返回值。,这三个数据用于配置http请求的tls。
2024-10-22 09:44:50
196
1
原创 go context
在Go里, 我们不能直接杀死协程, 协程的关闭一般会用channel+select方式/或者runtime.Goexit()来控制. 虽然能打到目的,但是如果在复杂派生场景下,就会显得乏力了. 于是就引出了Context!context主要用来在goroutine之间传递上下文信息,包括:(withcancel) 取消信号、(withdeadline) 超时时间、(withtimeout) 截止时间、(withvalue) k-v键值对数据context接口四个方法:type .
2022-05-13 03:05:25
293
原创 go bufio.reader.read()
Golang bufio(Reader)ReadGolang bufio前言一、原理二、案例1.pGreaterThanbr2.pLessThanbr总结前言bufio.reader.read() 详细解析!一、原理func (br *Reader) Read(p []byte) (n int, err error),Read 方法读取数据到字节切片p中,返回读取的字节数和产生的 error: 1.当缓冲区有效数据非空时: (即:bufio.reader.buffered() != 0)
2022-04-26 23:25:31
1128
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人