Closed liori closed 5 months ago
The Sys()
function signature is already defined by the os.FileInfo
interface. And there’s not really a strong reason why we would want to provide Yet Another Accessor, when type assertion works just fine to unwrap the interface{}
.
Thinking about this a little more. It wouldn’t even be particularly useful, as one would need to type-assert from the os.FileInfo
into an interface{ FileStat() *sftp.FileStat }
in order to access the proposed typed return anyways.
I’m going to go ahead and close this as we have no intent to provide such a function, and even after providing such a function, a type inference would still be necessary.
For the purposes of this PR it would be nice if sftp offered a strongly-typed accessor for the
sftp.FileStat
structure.Would it be possible for the
fileInfoFromStat
function to return something assignable toos.FileInfo
, but also offering a method to access thestat
field without having to convert frominterface{}
?