Documentation ¶
Overview ¶
The purpose of this program is to test creating a Read Method who follows the rule for Read methods, by taking a []byte as input, and returning n characters read, and an error telling when done or failed.
We will create a new type called storage, which can hold some data of type string The storage type shall have a read method, to read the content of the storage into a variable. There shall also be a function to create and initialize a new storage (will be done in next version)
Since our new type has a Read method, it will also satisfy the interface io.Reader. We will create another read-something function which takes an io.Reader as input to demonstrate that we can now use myStorage as input where it is asked for io.Reader as input type.