diff options
author | Anthony Wang | 2022-03-30 16:29:47 -0500 |
---|---|---|
committer | Anthony Wang | 2022-03-30 16:29:47 -0500 |
commit | fdae736f2217df294f190f272bc0cd6eeb3c405b (patch) | |
tree | cd7d1abcb57d0a62e9b23f3ecace032714183495 | |
parent | 1da0d49de771aa7be917a76fe01d66e79283c5a0 (diff) |
Remove unneeded copy
-rw-r--r-- | modules/activitypub/client.go | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/modules/activitypub/client.go b/modules/activitypub/client.go index 072090912..9cd9f0dc3 100644 --- a/modules/activitypub/client.go +++ b/modules/activitypub/client.go @@ -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 |