In this lab, we'll be turning our simple wordbank into a user defined type.
- Create a
WordBank
struct with a single field: a slice of strings. - Create a function
NewWordBank
with no input that returns a pointer to an initialized WordBank. - Change getWord to be a method on the
*WordBank
type. Modify it to use the fields ofWordBank
instead of the package scoped string slice. - Modify the
generateSentence
function to take a*WordBank
as an additional input and use it to generate the words - Modify the
generateIpsum
function to create an instance of thisWordBank
type by calling the constructor and pass it intogenerateSentence
.