20 年 10 月份,Go 掌舵人 Russ Cox 已经有废弃 ioutil 包的提案[1],废弃原因是:io/ioutil, like most things with util in the name, has turned out to be a poorly defined and hard to understand collection of things.

后续的几次代码提交也证实了这一点,从 Go 1.16 开始会废弃 io/ioutil 包,相关的功能会挪到 io 包或 os 包

相关连接 https://github.com/go-critic/go-critic/issues/1019

例如 ioutil.NopCloser方法, 改为io.NopCloser方法即可