Ai
1 Star 0 Fork 0

mosache/go-zero

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
lesswriter.go 396 Bytes
一键复制 编辑 原始数据 按行查看 历史
kevwan 提交于 2020-07-26 17:09 +08:00 . initial import
package logx
import "io"
type lessWriter struct {
*limitedExecutor
writer io.Writer
}
func NewLessWriter(writer io.Writer, milliseconds int) *lessWriter {
return &lessWriter{
limitedExecutor: newLimitedExecutor(milliseconds),
writer: writer,
}
}
func (w *lessWriter) Write(p []byte) (n int, err error) {
w.logOrDiscard(func() {
w.writer.Write(p)
})
return len(p), nil
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/mosache/go-zero.git
git@gitee.com:mosache/go-zero.git
mosache
go-zero
go-zero
dfb45c801a6c

搜索帮助