aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/github.com/shurcooL/vfsgen/stringwriter.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2020-02-05 22:03:19 +0100
committerMichael Muré <batolettre@gmail.com>2020-02-05 22:33:03 +0100
commit1d4bb7ceb0cef79d68df0bacc913b01e40e6ddd6 (patch)
treee088b0fa43058afde1db71541d8fcb4b94905d6e /vendor/github.com/shurcooL/vfsgen/stringwriter.go
parentf093be96e98284580d61664adecd0a2ff8b354e4 (diff)
downloadgit-bug-1d4bb7ceb0cef79d68df0bacc913b01e40e6ddd6.tar.gz
migrate to go modules
Diffstat (limited to 'vendor/github.com/shurcooL/vfsgen/stringwriter.go')
-rw-r--r--vendor/github.com/shurcooL/vfsgen/stringwriter.go27
1 files changed, 0 insertions, 27 deletions
diff --git a/vendor/github.com/shurcooL/vfsgen/stringwriter.go b/vendor/github.com/shurcooL/vfsgen/stringwriter.go
deleted file mode 100644
index a781efdc..00000000
--- a/vendor/github.com/shurcooL/vfsgen/stringwriter.go
+++ /dev/null
@@ -1,27 +0,0 @@
-package vfsgen
-
-import (
- "io"
-)
-
-// stringWriter writes given bytes to underlying io.Writer as a Go interpreted string literal value,
-// not including double quotes. It tracks the total number of bytes written.
-type stringWriter struct {
- io.Writer
- N int64 // Total bytes written.
-}
-
-func (sw *stringWriter) Write(p []byte) (n int, err error) {
- const hex = "0123456789abcdef"
- buf := []byte{'\\', 'x', 0, 0}
- for _, b := range p {
- buf[2], buf[3] = hex[b/16], hex[b%16]
- _, err = sw.Writer.Write(buf)
- if err != nil {
- return n, err
- }
- n++
- sw.N++
- }
- return n, nil
-}