首頁  >  文章  >  後端開發  >  無法開啟的檔案名

無法開啟的檔案名

王林
王林轉載
2024-02-08 21:03:041543瀏覽

無法開啟的檔案名

問題內容

我收到以下錯誤日誌:

2023/12/27 04:11:26 open : The system cannot find the file specified.

我有很多函數調用,例如:

    pth := "..."

    data, err := os.ReadFile(pth)
    if err != nil {
        log.Fatalf(err.Error())
    }

更輕鬆的調試

我想修改錯誤日誌,以便它們寫入無法開啟的檔案的確切名稱。有沒有一種自動方法可以強制日誌執行此操作?


正確答案


正如@icza 評論的:

就我而言:

以上是無法開啟的檔案名的詳細內容。更多資訊請關注PHP中文網其他相關文章!

陳述:
本文轉載於:stackoverflow.com。如有侵權,請聯絡admin@php.cn刪除