Commit a87eb7be authored by Christopher Schinnerl's avatar Christopher Schinnerl

fix linting

parent 82ad42de
Pipeline #57388086 passed with stages
in 26 minutes and 10 seconds
......@@ -409,14 +409,14 @@ func (c *Client) RenterUploadDefaultPost(path string, siaPath modules.SiaPath) (
// RenterUploadStreamPost uploads data using a stream. It will return a
// io.WriteCloser that can be used to write the data to the request body. The
// writer needs to be closed when done for the whole file to be uploaded.
func (c *Client) RenterUploadStreamPost(r io.Reader, siaPath string, dataPieces, parityPieces uint64, force bool) error {
siaPath = escapeSiaPath(trimSiaPath(siaPath))
func (c *Client) RenterUploadStreamPost(r io.Reader, siaPath modules.SiaPath, dataPieces, parityPieces uint64, force bool) error {
sp := escapeSiaPath(siaPath)
values := url.Values{}
values.Set("datapieces", strconv.FormatUint(dataPieces, 10))
values.Set("paritypieces", strconv.FormatUint(parityPieces, 10))
values.Set("force", strconv.FormatBool(force))
values.Set("stream", strconv.FormatBool(true))
_, err := c.postRawResponse(fmt.Sprintf("/renter/uploadstream/%s?%s", siaPath, values.Encode()), r)
_, err := c.postRawResponse(fmt.Sprintf("/renter/uploadstream/%s?%s", sp, values.Encode()), r)
return err
}
......
......@@ -311,9 +311,12 @@ func testUploadStreaming(t *testing.T, tg *siatest.TestGroup) {
d := bytes.NewReader(data)
// Upload the data.
siaPath := "/foo"
siaPath, err := modules.NewSiaPath("/foo")
if err != nil {
t.Fatal(err)
}
r := tg.Renters()[0]
err := r.RenterUploadStreamPost(d, siaPath, 1, uint64(len(tg.Hosts())-1), false)
err = r.RenterUploadStreamPost(d, siaPath, 1, uint64(len(tg.Hosts())-1), false)
if err != nil {
t.Fatal(err)
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment