package main
import (
+ "context"
"crypto/rand"
- "errors"
"fmt"
"git.curoverse.com/arvados.git/sdk/go/keepclient"
"io"
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()
}
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)
// Put block
var PutContent = func(content []byte, locator string) (err error) {
- _, err = PutBlock(content, locator)
+ _, err = PutBlock(context.TODO(), content, locator)
return
}