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
The definition of Read in io.Reader is currently fn Read (p: [byte]) -> Result<int>. I believe this limits it to returning only one of the number of bytes read or an error. But this does not reflect what Read does. From go's docs, Read "returns the number of bytes read (0 <= n <= len(p)) and any error encountered" (emphasis added). There is further discussion of this in several golang-nuts threads such as this one.
(Apologies if I misunderstood something here. I know more go than rust, and I ended up here thanks to an interesting-sounding link from go weekly news.)
The text was updated successfully, but these errors were encountered:
You're totally correct! Most bindings are generated automatically and I suspect there are a few more instances of cases like this. At the moment, the compiler struggles a bit with functions that return multiple values where all values are meaningful (such in this case). Shouldn't be too hard to fix though.
The definition of Read in io.Reader is currently
fn Read (p: [byte]) -> Result<int>
. I believe this limits it to returning only one of the number of bytes read or an error. But this does not reflect what Read does. From go's docs, Read "returns the number of bytes read (0 <= n <= len(p)) and any error encountered" (emphasis added). There is further discussion of this in several golang-nuts threads such as this one.(Apologies if I misunderstood something here. I know more go than rust, and I ended up here thanks to an interesting-sounding link from go weekly news.)
The text was updated successfully, but these errors were encountered: