diff --git a/eBook/12.7.md b/eBook/12.7.md index f70f518..2dcfb5e 100644 --- a/eBook/12.7.md +++ b/eBook/12.7.md @@ -4,10 +4,10 @@ ```go func data(name string) string { - f := os.Open(name, os.O_RDONLY, 0) + f, _ := os.OpenFile(name, os.O_RDONLY, 0) defer f.Close() // idiomatic Go code! - contents := io.ReadAll(f) - return contents + contents, _ := ioutil.ReadAll(f) + return string(contents) } ```