mirror of
https://github.com/unknwon/the-way-to-go_ZH_CN.git
synced 2025-08-12 01:55:35 +08:00
update book code
This commit is contained in:
10
eBook/examples/chapter_12/filewrite.go
Normal file
10
eBook/examples/chapter_12/filewrite.go
Normal file
@@ -0,0 +1,10 @@
|
||||
package main
|
||||
|
||||
import "os"
|
||||
|
||||
func main() {
|
||||
os.Stdout.WriteString("hello, world\n")
|
||||
f, _ := os.OpenFile("test", os.O_CREATE|os.O_WRONLY, 0)
|
||||
defer f.Close()
|
||||
f.WriteString("hello, world in a file\n")
|
||||
}
|
Reference in New Issue
Block a user