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
Note that in the call to F, the type parameter T ends up being inferred as io.Reader, which is not explicitly imported (although of course it is transitively). This results in the following confusing errors:
./prog.go2:9: cannot use ioutil.ReadAll (type func(io.Reader) ([]byte, error)) as type func(<T>) ([]byte, error) in argument to instantiate୦୦F୦io୮aReader୦୮6୮7byte
./prog.go2:7: undefined: io in io.Reader
Adding a blank import _ "io" works around the problem; presumably this shouldn't be necessary.
The text was updated successfully, but these errors were encountered:
Consider the following code (playground):
Note that in the call to
F
, the type parameterT
ends up being inferred asio.Reader
, which is not explicitly imported (although of course it is transitively). This results in the following confusing errors:Adding a blank import
_ "io"
works around the problem; presumably this shouldn't be necessary.The text was updated successfully, but these errors were encountered: