mirror of
https://github.com/go-gitea/gitea
synced 2024-12-27 02:54:27 +00:00
Remove unneeded copy
This commit is contained in:
parent
1da0d49de7
commit
fdae736f22
@ -100,9 +100,7 @@ func NewClient(user *user_model.User, pubID string) (c *Client, err error) {
|
|||||||
|
|
||||||
// NewRequest function
|
// NewRequest function
|
||||||
func (c *Client) NewRequest(b []byte, to string) (req *http.Request, err error) {
|
func (c *Client) NewRequest(b []byte, to string) (req *http.Request, err error) {
|
||||||
byteCopy := make([]byte, len(b))
|
buf := bytes.NewBuffer(b)
|
||||||
copy(byteCopy, b)
|
|
||||||
buf := bytes.NewBuffer(byteCopy)
|
|
||||||
req, err = http.NewRequest(http.MethodPost, to, buf)
|
req, err = http.NewRequest(http.MethodPost, to, buf)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user