Skip to content

Commit

Permalink
chore: remove refs to deprecated io/ioutil
Browse files Browse the repository at this point in the history
Signed-off-by: guoguangwu <[email protected]>
  • Loading branch information
testwill committed May 11, 2024
1 parent a1c6c7d commit 2d77680
Show file tree
Hide file tree
Showing 3 changed files with 683 additions and 684 deletions.
4 changes: 2 additions & 2 deletions api_getUploadFileUrl.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package notionapi

import (
"fmt"
"io/ioutil"
"io"
"mime"
"net/http"
"os"
Expand Down Expand Up @@ -163,7 +163,7 @@ func (c *Client) UploadFile(file *os.File) (fileID, fileURL string, err error) {
defer resp.Body.Close()
if resp.StatusCode != 200 {
var contents []byte
contents, err = ioutil.ReadAll(resp.Body)
contents, err = io.ReadAll(resp.Body)
if err != nil {
contents = []byte(fmt.Sprintf("Error from ReadAll: %s", err))
}
Expand Down
Loading

0 comments on commit 2d77680

Please sign in to comment.