1
0
mirror of https://github.com/gusaul/grpcox.git synced 2025-04-17 19:25:37 +00:00

fix panic when folder log not exists

This commit is contained in:
annlumia 2023-01-20 18:33:27 +07:00
parent f240d0494e
commit 40bca6e2af

View File

@ -15,6 +15,11 @@ import (
)
func main() {
// create folder "log" if not exists
if _, err := os.Stat("log"); os.IsNotExist(err) {
os.Mkdir("log", os.ModePerm)
}
// logging conf
f, err := os.OpenFile("log/grpcox.log", os.O_RDWR|os.O_CREATE|os.O_APPEND, 0666)
if err != nil {