go-golangci-lint 检测http的警告,为什么对于PostForm Get这些官方封装的接口禁止使用呢?
1. 运行环境.
go 1.18
lint@1.50.1"">golangci-lint@1.50.1 使用默认检测项
2. 问题描述?
使用官方http库,调用PostForm Get等接口,总是检测警告,报告诸如
(net/http.Client).PostForm must not be called (noctx)go-golangci-lint
(net/http.Client).Get must not be called (noctx)go-golangci-lint
3. 您期望得到的结果?
为什么官方封装的接口要禁止使用呢?有时候使用这些接口是很方便的,即使不使用,自己写也是相同的代码。
推荐文章: