this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Replace deprecated ioutil.ReadAll, ioutil.WriteFile (#211)

Cleaning up a deprecation to ioutil.ReadAll, ioutil.WriteFile.
it's deprecated to go1.16.

authored by

Whyrusleeping and committed by
GitHub
9934ef7b a2c035fb

+4 -6
+2 -3
api/extra.go
··· 4 4 "context" 5 5 "fmt" 6 6 "io" 7 - "io/ioutil" 8 7 "net" 9 8 "net/http" 10 9 "net/url" ··· 98 97 return "", fmt.Errorf("http well-known route returned too much data") 99 98 } 100 99 101 - b, err := ioutil.ReadAll(io.LimitReader(resp.Body, 2048)) 100 + b, err := io.ReadAll(io.LimitReader(resp.Body, 2048)) 102 101 if err != nil { 103 102 return "", fmt.Errorf("failed to read resolved did: %w", err) 104 103 } ··· 158 157 continue 159 158 } 160 159 161 - b, err := ioutil.ReadAll(resp.Body) 160 + b, err := io.ReadAll(resp.Body) 162 161 if err != nil { 163 162 return "", fmt.Errorf("failed to read resolved did: %w", err) 164 163 }
+2 -3
cmd/gosky/debug.go
··· 6 6 "encoding/json" 7 7 "fmt" 8 8 "io" 9 - "io/ioutil" 10 9 "net/http" 11 10 "os" 12 11 "os/signal" ··· 717 716 } 718 717 defer jsonFile.Close() 719 718 720 - byteValue, err := ioutil.ReadAll(jsonFile) 719 + byteValue, err := io.ReadAll(jsonFile) 721 720 if err != nil { 722 721 return nil, fmt.Errorf("failed to read file: %w", err) 723 722 } ··· 736 735 return fmt.Errorf("failed to marshal json: %w", err) 737 736 } 738 737 739 - err = ioutil.WriteFile(filename, file, 0644) 738 + err = os.WriteFile(filename, file, 0644) 740 739 if err != nil { 741 740 return fmt.Errorf("failed to write file: %w", err) 742 741 }