From 5f92c3b3fc610f9868aeefdcbd7aa63ef7f7ec80 Mon Sep 17 00:00:00 2001 From: xushiwei Date: Fri, 2 Aug 2024 14:26:13 +0800 Subject: [PATCH 1/2] library: io/ioutil --- _cmptest/ioutildemo/ioutil.go | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 _cmptest/ioutildemo/ioutil.go diff --git a/_cmptest/ioutildemo/ioutil.go b/_cmptest/ioutildemo/ioutil.go new file mode 100644 index 00000000..723068e7 --- /dev/null +++ b/_cmptest/ioutildemo/ioutil.go @@ -0,0 +1,19 @@ +package main + +import ( + "fmt" + "io/ioutil" + "log" + "strings" +) + +func main() { + r := strings.NewReader("Go is a general-purpose language designed with systems programming in mind.") + + b, err := ioutil.ReadAll(r) + if err != nil { + log.Fatal(err) + } + + fmt.Printf("%s\n", b) +} From c1868464630d4dd55583727eee2a619c0f89e868 Mon Sep 17 00:00:00 2001 From: xushiwei Date: Fri, 2 Aug 2024 14:27:10 +0800 Subject: [PATCH 2/2] README: io/ioutil --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 0c990e7a..22db1411 100644 --- a/README.md +++ b/README.md @@ -277,6 +277,7 @@ Here are the Go packages that can be imported correctly: * [context](https://pkg.go.dev/context) * [io](https://pkg.go.dev/io) * [io/fs](https://pkg.go.dev/io/fs) +* [io/ioutil](https://pkg.go.dev/io/ioutil) * [log](https://pkg.go.dev/log) * [flag](https://pkg.go.dev/flag) * [sort](https://pkg.go.dev/sort)