1
1
mirror of https://github.com/go-gitea/gitea synced 2024-11-03 16:54:25 +00:00

Remove unneeded copy

This commit is contained in:
Anthony Wang 2022-03-30 16:29:47 -05:00
parent 1da0d49de7
commit fdae736f22
No known key found for this signature in database
GPG Key ID: BC96B00AEC5F2D76

View File

@ -100,9 +100,7 @@ func NewClient(user *user_model.User, pubID string) (c *Client, err error) {
// NewRequest function
func (c *Client) NewRequest(b []byte, to string) (req *http.Request, err error) {
byteCopy := make([]byte, len(b))
copy(byteCopy, b)
buf := bytes.NewBuffer(byteCopy)
buf := bytes.NewBuffer(b)
req, err = http.NewRequest(http.MethodPost, to, buf)
if err != nil {
return