package main
import (
"fmt"
"io/ioutil"
"os"
)
func main() {
content, err := ioutil.ReadFile("d:/fileOpen.txt") // Read all the contents of a file at once, which can affect performance when the file is large
if err != nil {
fmt.Println("read file err:", err)
os.Exit(2)
}
fmt.Println(string(content))
}