Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
71 lines (50 sloc) 1.9 KB

CLI Rescue exercise


  1. Start by forking this repo so you have your own copy.
  2. clone the repo in your Go path:
github_user=$(git config github.user)
mkdir -p $GOPATH/src/$github_user
cd $GOPATH/src/$github_user
git clone$github_user/clirescue.git
cd clirescue

Install the dependencies:

go get

Load the project into your editor and do a search and replace:

  • Replace:
  • With:<github-username>

Commit the change:

git commit -a -m "forking repo requires internal code changes"

If everything is properly setup, you should be able to run your code:

go run main.go

You can use the following demo Pivotal Tracker account:

  • Username: gobootcamp
  • Password: santamonica

Start rescuing

This code was written by someone who just started learning Go. Beginners often make the same mistakes so assume that this is your code and you are now tasked to refactor it. The end goal is to create a CLI to interface with the Pivotal Tracker API.

The first step is to return the user details and to store the user token on the drive so next calls can automatically be made without asking for the user's username and password.

A few hints:

  • Understanding Go path's system might be a bit tricky at first.
  • Forking the repo might affect your import statements.
  • The original author might not have made a good use of packages.
  • You more thna likely have some OOP experience, you might want to leverage it in this exercise.
  • Checkout the init function.
  • Curious about how a 3rd party lib works? Try go doc.
  • Simpler is better.
  • Look into how to write tests.
  • Bonus point for removing 3rd part dependencies.

As always, refer to the Effective Go doc if you have any questions.