Giter Site home page Giter Site 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/GoBootcamp
  • 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

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

clirescue's Issues

Pivotal Tracker credentials no longer valid

The instructions in the README say

You can use the following demo Pivotal Tracker account:

Username: gobootcamp
Password: santamonica

returns the message:

API response: 
{"code":"invalid_authentication","kind":"error","error":"Invalid authentication credentials were presented.","possible_fix":"Recheck your name (email address or Tracker username) and password."}

I was able to create a Pivotal Tracker account for myself that is free for 30 days and will see how far I can get with the project refactor during that time.

Initial issues after installing

on running $ go run main.go

# command-line-arguments
./main.go:16:15: cannot use []cli.Command literal (type []cli.Command) as type []*cli.Command in assignment
./main.go:20:4: cannot use func literal (type func(*cli.Context)) as type cli.ActionFunc in
field value

Demo pivotal tracker account

Hi,

If I try to use "gobootcamp" account I get the following response

Username: gobootcamp
Password: 
API response: 
{"code":"invalid_authentication","kind":"error","error":"Invalid authentication credentials were presented.","possible_fix":"Recheck your name (email address or Tracker username) and password."}

Looks like the credentials are invalid. Do you have any other account that we can use?

Thanks!

readme instructions need updates

Fixes for readme instructions:

In Setup step 2.

go get github.com/$github_user/clirescue.git
cd $GOPATH/src/github.com/clirescue

There were no instructions on GoBootCamp or in this readme to setup the environment variable, $github_user. This is confusing for someone getting started.

Stevens-MacBook-Pro:go$ echo $github_user

Stevens-MacBook-Pro:go$

Second command:

Stevens-MacBook-Pro:go xxx$ cd $GOPATH/src/github.com/clirescue
-bash: cd: /Users/xxx/go/src/github.com/clirescue: No such file or directory

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.