summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2017-11-16 15:31:55 -0500
committerLuke Shumaker <lukeshu@lukeshu.com>2017-11-16 15:31:55 -0500
commit6286191ce6d24c8f48ce2fea40eab59c291654d4 (patch)
treec35906358e2b0c30f8f535c8fac5794b97bd995d
parent17e8573c8f240191f267206784c80e5c9131302f (diff)
gofmt
-rw-r--r--backend.go4
-rw-r--r--parse_catblob.go10
-rw-r--r--textproto/io.go2
3 files changed, 8 insertions, 8 deletions
diff --git a/backend.go b/backend.go
index 4d03d46..3bf07b5 100644
--- a/backend.go
+++ b/backend.go
@@ -1,8 +1,8 @@
package libfastimport
import (
- "io"
"bufio"
+ "io"
"git.lukeshu.com/go/libfastimport/textproto"
)
@@ -10,7 +10,7 @@ import (
// A Backend is something that consumes a fast-import stream; the
// Backend object provides methods for writing to it.
type Backend struct {
- w *bufio.Writer
+ w *bufio.Writer
fiw *textproto.FIWriter
cbr *textproto.CatBlobReader
}
diff --git a/parse_catblob.go b/parse_catblob.go
index 53f7d52..5daaa77 100644
--- a/parse_catblob.go
+++ b/parse_catblob.go
@@ -2,8 +2,8 @@ package libfastimport
import (
"fmt"
- "strings"
"strconv"
+ "strings"
"git.lukeshu.com/go/libfastimport/textproto"
)
@@ -38,7 +38,7 @@ func cbpCatBlob(full string) (sha1 string, data string, err error) {
return "", "", fmt.Errorf("cat-blob: malformed header: %q", full)
}
head := full[:lf]
- data = full[lf+1:len(full)-1]
+ data = full[lf+1 : len(full)-1]
if len(head) < 40+6+1 {
return "", "", fmt.Errorf("cat-blob: malformed header: %q", head)
@@ -75,7 +75,7 @@ func cbpLs(line string) (mode textproto.Mode, dataref string, path textproto.Pat
return 0, "", "", fmt.Errorf("ls: missing trailing newline")
}
if strings.HasPrefix(line, "missing ") {
- strPath := line[8:len(line)-1]
+ strPath := line[8 : len(line)-1]
return 0, "", textproto.PathUnescape(strPath), nil
} else {
sp1 := strings.IndexByte(line, ' ')
@@ -85,8 +85,8 @@ func cbpLs(line string) (mode textproto.Mode, dataref string, path textproto.Pat
return 0, "", "", fmt.Errorf("ls: malformed line: %q", line)
}
strMode := line[:sp1]
- strRef := line[sp2+1:ht]
- strPath := line[ht+1:len(line)-1]
+ strRef := line[sp2+1 : ht]
+ strPath := line[ht+1 : len(line)-1]
nMode, err := strconv.ParseUint(strMode, 8, 18)
if err != nil {
diff --git a/textproto/io.go b/textproto/io.go
index 1b6402b..f31f950 100644
--- a/textproto/io.go
+++ b/textproto/io.go
@@ -128,7 +128,7 @@ type CatBlobWriter struct {
}
func NewCatBlobWriter(w io.Writer) *CatBlobWriter {
- return &CatBlobWriter {
+ return &CatBlobWriter{
w: w,
}
}