Skip to content

Instantly share code, notes, and snippets.

@garry415
Last active March 8, 2016 18:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save garry415/bd83a3693bf03dbd5438 to your computer and use it in GitHub Desktop.
Save garry415/bd83a3693bf03dbd5438 to your computer and use it in GitHub Desktop.
// "go build" successful
// "gomobile build" fails with
// "gomobile: type io.Reader not defined in package package readsomething ("github.com/garry415/gomobile/reader")
package readsomething
import (
"io"
"io/ioutil"
)
func ReadSomething(r io.Reader) ([]byte, error) {
result, err := ioutil.ReadAll(r)
if err != nil {
return nil, err
}
return result, nil
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment