Hi,
I was reading https://tip.golang.org/pkg/io/fs/#File and noticed that 
interface File is not embedding io.ReadCloser. Even though the signature of 
the methods are identical, It would probably be a good idea to embed 
io.ReadCloser (or both io.Reader and io.Closer) to state the intention of 
making them compatible (and also have the excellent documentation on how to 
implement those methods).
So my actual question could be rephrased: is io/fs.File's Read and Close 
methods intended to be used in the exact same way as io.ReadCloser? If so, 
is there a reason why it is re-defining those two methods on its own? If 
not, wouldn't it be better to have different method names to avoid any 
confusion?

Thank you!

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/5d7238d9-ce52-4c5d-95b2-c0d0a5346a7bn%40googlegroups.com.

Reply via email to