Merge pull request #644 from xushiwei/q

library: io/ioutil
This commit is contained in:
xushiwei
2024-08-02 14:35:23 +08:00
committed by GitHub
2 changed files with 20 additions and 0 deletions

View File

@@ -277,6 +277,7 @@ Here are the Go packages that can be imported correctly:
* [context](https://pkg.go.dev/context) * [context](https://pkg.go.dev/context)
* [io](https://pkg.go.dev/io) * [io](https://pkg.go.dev/io)
* [io/fs](https://pkg.go.dev/io/fs) * [io/fs](https://pkg.go.dev/io/fs)
* [io/ioutil](https://pkg.go.dev/io/ioutil)
* [log](https://pkg.go.dev/log) * [log](https://pkg.go.dev/log)
* [flag](https://pkg.go.dev/flag) * [flag](https://pkg.go.dev/flag)
* [sort](https://pkg.go.dev/sort) * [sort](https://pkg.go.dev/sort)

View File

@@ -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)
}