summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--local.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/local.go b/local.go
index 0aa8d1f..c2e16f6 100644
--- a/local.go
+++ b/local.go
@@ -81,7 +81,7 @@ func (a *LocalConn) CheckQueue(url string, timeout int64) (Qmsg, error) {
if err != nil && err != io.EOF {
return Qmsg{}, err
}
- s = strings.TrimSpace(s)
+ s = strings.TrimRight(s, "\n")
return Qmsg{Body: s, Handle: s}, nil
}
@@ -184,12 +184,12 @@ func (a *LocalConn) DelFromQueue(url string, handle string) error {
// store the joining of part before and part after handle
var complete string
- // the '+2' is 1 for newline character + 1 to move beyond handle
- if len(s) >= len(handle) + 2 {
+ if len(s) >= len(handle) + 1 {
if i > 0 {
complete = s[:i]
}
- complete += s[i + len(handle) + 2:]
+ // the '+1' is for the newline character
+ complete += s[i + len(handle) + 1:]
}
f, err := os.Create(filepath.Join(a.TempDir, url))