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:
parent
c026786979
commit
cdbef99766
1 changed files with 1 additions and 2 deletions
|
@ -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)
|
||||||
|
|
Loading…
Reference in a new issue