djdv / go-filesystem-utils

ISC License
10 stars 2 forks source link

IPFS: UFS wrapper could likely be reduced #33

Open djdv opened 1 year ago

djdv commented 1 year ago

_Extracted from: https://github.com/djdv/go-filesystem-utils/pull/27#discussion_r1198932272_

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.