If there are no errors, http.Dir calls os.Open once every time Open is called. If the file has not changed, performance can be improved by reducing system calls by caching *os.File and byte read from *os.File.
One implementation that comes to mind is to determine whether a file has been modified based on whether the file modification time has changed.
A prototype in a third-party library shows that this does improve performance.
However, in my thinking before sending CL, it occurred to me that my implementation relies on the assumption that the file modification time remains unchanged while the file content remains unchanged. I am not sure whether this conforms to the go1 compatibility promise. Not sure if you need to add the GODEBUG environment variable to preserve the old behavior?
I need help to solve the above problem that is preventing me from sending CL! If anyone can answer the above questions, thank you very much!