summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--textproto/io.go24
1 files changed, 10 insertions, 14 deletions
diff --git a/textproto/io.go b/textproto/io.go
index cb0105b..9e8f532 100644
--- a/textproto/io.go
+++ b/textproto/io.go
@@ -19,13 +19,11 @@ func NewFIReader(r io.Reader) *FIReader {
}
func (fir *FIReader) ReadLine() (line string, err error) {
-retry:
- line, err = fir.r.ReadString('\n')
- if err != nil {
- return
- }
- if len(line) == 1 {
- goto retry
+ for len(line) <= 1 {
+ line, err = fir.r.ReadString('\n')
+ if err != nil {
+ return
+ }
}
if strings.HasPrefix(line, "data ") {
@@ -92,13 +90,11 @@ func NewCatBlobReader(r io.Reader) *CatBlobReader {
}
func (cbr *CatBlobReader) ReadLine() (line string, err error) {
-retry:
- line, err = cbr.r.ReadString('\n')
- if err != nil {
- return
- }
- if len(line) == 1 {
- goto retry
+ for len(line) <= 1 {
+ line, err = cbr.r.ReadString('\n')
+ if err != nil {
+ return
+ }
}
// get-mark : <sha1> LF