Home >Backend Development >Golang >Unable to open file name
I received the following error log:
2023/12/27 04:11:26 open : The system cannot find the file specified.
I have many function calls, for example:
pth := "..." data, err := os.ReadFile(pth) if err != nil { log.Fatalf(err.Error()) }
I want to modify the error logs so that they write the exact name of the file that cannot be opened. Is there an automated way to force the log to do this?
As @icza commented:
As for me:
The above is the detailed content of Unable to open file name. For more information, please follow other related articles on the PHP Chinese website!