Updating the phone book application
In this section we will change the format that the phone application uses for storing its data. This time, the phone book application uses JSON all over. Additionally, it uses the cobra
package for implementing the supported commands. As a result, all relevant code resides on its own GitHub repository and not in the ch06
directory of the GitHub repository of this book. The path of the GitHub repository is https://github.com/mactsouk/phonebook—you can git clone
that directory if you want but try to create your own version if you have the time.
When developing real applications, do not forget to git commit
and git push
your changes from time to time to ensure that you keep a history of the development phase in GitHub or GitLab. Among other things, this is a good way to keep backups!
Using cobra
First, you need to create an empty GitHub repository and clone it:
$ cd ~/go/src/github.com/mactsouk
$ git clone git@github...