Remove unused imports and use a non-pointer reader (#96)

* Fix #95 by removing unused imports and using a non-pointer reader

Signed-off-by: Jonas Franz <info@jonasfranz.software>

(cherry picked from commit f46f7c8)
Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Replace *io.Reader with io.Reader

Signed-off-by: Jonas Franz <info@jonasfranz.software>
This commit is contained in:
Jonas Franz 2018-03-02 15:48:43 +01:00 committed by Bo-Yi Wu
parent c026786979
commit cdbef99766

View file

@ -8,7 +8,6 @@ import (
"encoding/json" "encoding/json"
"fmt" "fmt"
"io" "io"
"io/ioutil"
"mime/multipart" "mime/multipart"
"net/http" "net/http"
"time" "time"
@ -46,7 +45,7 @@ func (c *Client) GetReleaseAttachment(user, repo string, release int64, id int64
} }
// CreateReleaseAttachment creates an attachment for the given release // CreateReleaseAttachment creates an attachment for the given release
func (c *Client) CreateReleaseAttachment(user, repo string, release int64, file *io.Reader, filename string) (*Attachment, error) { func (c *Client) CreateReleaseAttachment(user, repo string, release int64, file io.Reader, filename string) (*Attachment, error) {
// Write file to body // Write file to body
body := new(bytes.Buffer) body := new(bytes.Buffer)
writer := multipart.NewWriter(body) writer := multipart.NewWriter(body)