mirror of
https://github.com/issadarkthing/gomu.git
synced 2025-04-28 13:48:53 +08:00
22 lines
296 B
Go
22 lines
296 B
Go
package main
|
|
|
|
import "os"
|
|
|
|
func log(text string) {
|
|
|
|
f, err := os.OpenFile("message.log", os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)
|
|
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
|
|
if _, err := f.Write([]byte(text + "\n")); err != nil {
|
|
panic(err)
|
|
}
|
|
|
|
if err := f.Close(); err != nil {
|
|
panic(err)
|
|
}
|
|
|
|
}
|