1 Star 0 Fork 1

常清静矣/golang-100

forked from 蓝桥云课/golang-100 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
053-stopLogger.go 360 Bytes
一键复制 编辑 原始数据 按行查看 历史
konroyliu 提交于 2021-01-11 10:51 . golang-100 answer
package main
import (
"io/ioutil"
"log"
)
func main() {
// If you want to disable log output (during test for example)
// you have to set the logger ouput to ioutil.Discard
// which is an io.Writer on which all Write calls succeed
// without doing anything
log.SetOutput(ioutil.Discard)
log.Println("log disabled")
// Output:
//
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/syongaaa/golang-100.git
git@gitee.com:syongaaa/golang-100.git
syongaaa
golang-100
golang-100
master

搜索帮助