The files.File we embed here, is derived from unixfsfile.NewUnixfsFile which takes in a context already, and has simillar semantics internally (it cancels on Close).
Our wrapper could probably be reduced to remove some redundancy, instead just relying on the embedded methods and behaviour being hoisted up.
This might be true for other types too. But requires peeking into the implementations they wrap.
_Extracted from: https://github.com/djdv/go-filesystem-utils/pull/27#discussion_r1198932272_
The
files.File
we embed here, is derived fromunixfsfile.NewUnixfsFile
which takes in a context already, and has simillar semantics internally (it cancels onClose
).Our wrapper could probably be reduced to remove some redundancy, instead just relying on the embedded methods and behaviour being hoisted up.
This might be true for other types too. But requires peeking into the implementations they wrap.