ioutil: Remove deprecated functions where possible

This commit is contained in:
Jöran Karl
2024-05-30 21:34:11 +02:00
parent 18a81f043c
commit 6e8daa117a
12 changed files with 29 additions and 39 deletions

View File

@@ -4,7 +4,7 @@ package main
import (
"fmt"
"io/ioutil"
"io"
"net/http"
"os/exec"
"strings"
@@ -19,7 +19,7 @@ func main() {
return
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
body, err := io.ReadAll(resp.Body)
var data interface{}

View File

@@ -4,7 +4,6 @@ package main
import (
"fmt"
"io/ioutil"
"log"
"os"
"regexp"
@@ -210,7 +209,7 @@ func main() {
var tests []test
for _, filename := range os.Args[1:] {
source, err := ioutil.ReadFile(filename)
source, err := os.ReadFile(filename)
if err != nil {
log.Fatalln(err)
}