mirror of
https://gitee.com/johng/gf
synced 2026-07-06 21:45:34 +08:00
21 lines
246 B
Go
21 lines
246 B
Go
package main
|
|
|
|
import (
|
|
"os"
|
|
"time"
|
|
)
|
|
|
|
func main() {
|
|
file, err := os.Create("/tmp/testfile")
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
for {
|
|
_, err = file.Write([]byte("test\n"))
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
time.Sleep(5 * time.Second)
|
|
}
|
|
}
|