bump(github.com/jteeuwen/go-bindata): 79847ab3e91ae5d2e1b18796c1795c78f29565d7
This commit is contained in:
30
third_party/github.com/jteeuwen/go-bindata/lib/stringwriter.go
vendored
Normal file
30
third_party/github.com/jteeuwen/go-bindata/lib/stringwriter.go
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
// 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 (
|
||||
"fmt"
|
||||
"io"
|
||||
)
|
||||
|
||||
type StringWriter struct {
|
||||
io.Writer
|
||||
c int
|
||||
}
|
||||
|
||||
func (w *StringWriter) Write(p []byte) (n int, err error) {
|
||||
if len(p) == 0 {
|
||||
return
|
||||
}
|
||||
|
||||
for n = range p {
|
||||
fmt.Fprintf(w.Writer, "\\x%02x", p[n])
|
||||
w.c++
|
||||
}
|
||||
|
||||
n++
|
||||
|
||||
return
|
||||
}
|
Reference in New Issue
Block a user