9701: Merge branch '9463-change-arvput-use-collection-class' into 9701-collection...
[arvados.git] / services / keepstore / pull_worker.go
index 2626d4bf68e1594f394ad4539f0f32a90fe00339..d53d1060e743e07d9d2bfba6b90c67376a1006ab 100644 (file)
@@ -2,7 +2,6 @@ package main
 
 import (
        "crypto/rand"
-       "errors"
        "fmt"
        "git.curoverse.com/arvados.git/sdk/go/keepclient"
        "io"
@@ -57,7 +56,7 @@ func PullItemAndProcess(pullRequest PullRequest, token string, keepClient *keepc
                return
        }
        if reader == nil {
-               return errors.New(fmt.Sprintf("No reader found for : %s", signedLocator))
+               return fmt.Errorf("No reader found for : %s", signedLocator)
        }
        defer reader.Close()
 
@@ -67,7 +66,7 @@ func PullItemAndProcess(pullRequest PullRequest, token string, keepClient *keepc
        }
 
        if (readContent == nil) || (int64(len(readContent)) != contentLen) {
-               return errors.New(fmt.Sprintf("Content not found for: %s", signedLocator))
+               return fmt.Errorf("Content not found for: %s", signedLocator)
        }
 
        err = PutContent(readContent, pullRequest.Locator)