mirror of
https://github.com/issadarkthing/gomu.git
synced 2025-05-12 19:29:33 +08:00
24 lines
328 B
Go
24 lines
328 B
Go
// Copyright (C) 2020 Raziman
|
|
|
|
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)
|
|
}
|
|
|
|
}
|