You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1 package main
2
3 import (
4 "fmt"
5 "os"
6 )
7
8 func main() {
9 file, err := os.Open("test.txt", os.O_APPEND | os.O_CREATE, 777)
10 defer file.Close()
11 if err != nil { panic(err) }
12 n, err := file.Write([]byte("hello world\n"))
13 if err != nil { panic(err) }
14 fmt.Print(n)
15 }
each time I run the exe, I don't not append string to the end ,but just recreate a file..
os: windows arch 386 go: 2011-3-7.1
The text was updated successfully, but these errors were encountered:
by tg8866:
The text was updated successfully, but these errors were encountered: