File tree Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Original file line number Diff line number Diff line change 11package mastodon
22
33import (
4- "io/ioutil "
4+ "io"
55 "net/http"
66 "os"
77 "strings"
@@ -39,7 +39,7 @@ func TestBase64Encode(t *testing.T) {
3939 if err != nil {
4040 t .Fatalf ("should not be fail: %v" , err )
4141 }
42- _ , err = ioutil .ReadAll (logo )
42+ _ , err = io .ReadAll (logo )
4343 if err != nil {
4444 t .Fatalf ("should not be fail: %v" , err )
4545 }
@@ -72,7 +72,7 @@ func TestString(t *testing.T) {
7272
7373func TestParseAPIError (t * testing.T ) {
7474 // No api error.
75- r := ioutil .NopCloser (strings .NewReader (`<html><head><title>404</title></head></html>` ))
75+ r := io .NopCloser (strings .NewReader (`<html><head><title>404</title></head></html>` ))
7676 err := parseAPIError ("bad request" , & http.Response {
7777 Status : "404 Not Found" ,
7878 StatusCode : http .StatusNotFound ,
@@ -84,7 +84,7 @@ func TestParseAPIError(t *testing.T) {
8484 }
8585
8686 // With api error.
87- r = ioutil .NopCloser (strings .NewReader (`{"error":"Record not found"}` ))
87+ r = io .NopCloser (strings .NewReader (`{"error":"Record not found"}` ))
8888 err = parseAPIError ("bad request" , & http.Response {
8989 Status : "404 Not Found" ,
9090 StatusCode : http .StatusNotFound ,
Original file line number Diff line number Diff line change 44 "bytes"
55 "context"
66 "fmt"
7- "io/ioutil"
87 "net/http"
98 "net/http/httptest"
109 "os"
@@ -878,7 +877,7 @@ func TestUploadMedia(t *testing.T) {
878877 if writerAttachment .ID != "123" {
879878 t .Fatalf ("want %q but %q" , "123" , attachment .ID )
880879 }
881- bytes , err := ioutil .ReadFile ("testdata/logo.png" )
880+ bytes , err := os .ReadFile ("testdata/logo.png" )
882881 if err != nil {
883882 t .Fatalf ("could not open file: %v" , err )
884883 }
You can’t perform that action at this time.
0 commit comments