You can download the code for this chapter from https://github.com/narenaryan/gorestful/tree/master/chapter2. Feel free to add the comments and pull requests. Clone the code and use the code samples in the chapter2 directory.