Golang bad file descriptor
问题 I am getting a bad file descriptor when trying to append to a logging file within my go routine. write ./log.log: bad file descriptor The file exists and has 666 for permissions. At first I thought well maybe it is because each one of them is trying to open the file at the same time. I implemented a mutex to try and avoid that but got the same issue so I removed it. logCh := make(chan string, 150) go func() { for { msg, ok := <-logCh if ok { if f, err := os.OpenFile("./log.log", os.O_APPEND,