summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2017-11-16 15:30:34 -0500
committerLuke Shumaker <lukeshu@lukeshu.com>2017-11-16 15:30:34 -0500
commitf0ffa10c863345ea3a9a301be035f78af175e17c (patch)
treeaba15bc1cf931c3a897af4abe505d9cacc5ce654
parentc16e4c36d4f5f5f9d6d21f4644b9c38b61159c47 (diff)
use 'string' instead of '[]byte' for data
-rw-r--r--commands.go6
-rw-r--r--ezfiw.go2
-rw-r--r--fileactions.go4
-rw-r--r--textproto/io.go4
4 files changed, 8 insertions, 8 deletions
diff --git a/commands.go b/commands.go
index 378b6b9..5085ed8 100644
--- a/commands.go
+++ b/commands.go
@@ -15,7 +15,7 @@ type CmdCommit struct {
Mark int // optional; < 1 for non-use
Author *textproto.UserTime
Committer textproto.UserTime
- Msg []byte
+ Msg string
From string
Merge []string
Tree []FileAction
@@ -58,7 +58,7 @@ type CmdTag struct {
RefName string
CommitIsh string
Tagger textproto.UserTime
- Data []byte
+ Data string
}
func (c CmdTag) fiWriteCmd(fiw *textproto.FIWriter) error {
@@ -90,7 +90,7 @@ func (c CmdReset) fiWriteCmd(fiw *textproto.FIWriter) error {
type CmdBlob struct {
Mark int
- Data []byte
+ Data string
}
func (c CmdBlob) fiWriteCmd(fiw *textproto.FIWriter) error {
diff --git a/ezfiw.go b/ezfiw.go
index 03b4622..2cc01b6 100644
--- a/ezfiw.go
+++ b/ezfiw.go
@@ -17,7 +17,7 @@ func (e *ezfiw) WriteLine(a ...interface{}) {
}
}
-func (e *ezfiw) WriteData(data []byte) {
+func (e *ezfiw) WriteData(data string) {
if e.err == nil {
e.err = e.fiw.WriteData(data)
}
diff --git a/fileactions.go b/fileactions.go
index d45b982..910fe5a 100644
--- a/fileactions.go
+++ b/fileactions.go
@@ -21,7 +21,7 @@ func (o FileModify) fiWriteFA(fiw *textproto.FIWriter) error {
type FileModifyInline struct {
Mode textproto.Mode
Path textproto.Path
- Data []byte
+ Data string
}
func (o FileModifyInline) fiWriteFA(fiw *textproto.FIWriter) error {
@@ -74,7 +74,7 @@ func (o NoteModify) fiWriteFA(fiw *textproto.FIWriter) error {
type NoteModifyInline struct {
CommitIsh string
- Data []byte
+ Data string
}
func (o NoteModifyInline) fiWriteFA(fiw *textproto.FIWriter) error {
diff --git a/textproto/io.go b/textproto/io.go
index 9e8f532..1b6402b 100644
--- a/textproto/io.go
+++ b/textproto/io.go
@@ -70,12 +70,12 @@ func (fiw *FIWriter) WriteLine(a ...interface{}) error {
return err
}
-func (fiw *FIWriter) WriteData(data []byte) error {
+func (fiw *FIWriter) WriteData(data string) error {
err := fiw.WriteLine("data", len(data))
if err != nil {
return err
}
- _, err = fiw.w.Write(data)
+ _, err = io.WriteString(fiw.w, data)
return err
}