@@ -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)
|
||||||
|
|||||||
19
_cmptest/ioutildemo/ioutil.go
Normal file
19
_cmptest/ioutildemo/ioutil.go
Normal 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)
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user