Giter Club home page Giter Club logo

clirescue's Introduction

CLI Rescue exercise

Setup

  1. Start by forking this repo so you have your own copy.
  2. clone the repo in your Go path:
go get github.com/$github_user/clirescue.git
cd $GOPATH/src/github.com/clirescue

Install the dependencies:

go get github.com/codegangsta/cli

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

  • Replace: github.com/vandosant
  • With: github.com/<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 me

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 current code is asking the user for a username and password, the user details are fetched. Your first step might be to store the user token on the drive so next time the program is called, it can automatically load the user details be 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 and the go bootcamp book if you have any questions.

Existing refactors

clirescue's People

Contributors

drnic avatar mattetti avatar vandosant avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.