You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Example: our def ReadAll(filename string) (res string, err error) works only with fs files while Go's accepts abstract File interface that you can/need to get from os.Open. Go's API is about passing file descriptors around and explicitly closing them after. This is more verbose but also more flexible. Go's io.Reader might work with any streams of bytes, not just fs files.
At this point we must figure out how to implement streaming IO properly and these kinds of things are foundation for that.
The text was updated successfully, but these errors were encountered:
Example: our
def ReadAll(filename string) (res string, err error)
works only with fs files while Go's accepts abstractFile
interface that you can/need to get fromos.Open
. Go's API is about passing file descriptors around and explicitly closing them after. This is more verbose but also more flexible. Go'sio.Reader
might work with any streams of bytes, not just fs files.At this point we must figure out how to implement streaming IO properly and these kinds of things are foundation for that.
The text was updated successfully, but these errors were encountered: