1 Star 0 Fork 0

marker / go-bindata

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
stringwriter.go 551 Bytes
一键复制 编辑 原始数据 按行查看 历史
// This work is subject to the CC0 1.0 Universal (CC0 1.0) Public Domain Dedication
// license. Its contents can be found at:
// http://creativecommons.org/publicdomain/zero/1.0/
package bindata
import (
"io"
)
const lowerHex = "0123456789abcdef"
type StringWriter struct {
io.Writer
c int
}
func (w *StringWriter) Write(p []byte) (n int, err error) {
if len(p) == 0 {
return
}
buf := []byte(`\x00`)
var b byte
for n, b = range p {
buf[2] = lowerHex[b/16]
buf[3] = lowerHex[b%16]
w.Writer.Write(buf)
w.c++
}
n++
return
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/marker/go-bindata.git
git@gitee.com:marker/go-bindata.git
marker
go-bindata
go-bindata
v3.0.6

搜索帮助

344bd9b3 5694891 D2dac590 5694891