examples/github_task.go
func TaskGitHubUser(t *tasking.T) {
	if len(t.Args) == 0 {
		t.Error("No GitHub user login is provided!")
		return
	}

	login := t.Args[0]
	data, err := fetchGitHubUser(login)
	if err != nil {
		t.Error(err)
		return
	}

	url, ok := data["html_url"]
	if !ok {
		t.Errorf("No URL found for user login %s\n", login)
		return
	}

	t.Logf("The URL for user %s is %s\n", login, url)
}
func TaskGitHubUser(t *tasking.T) {
	if len(t.Args) == 0 {
		t.Error("No GitHub user login is provided!")
		return
	}

	login := t.Args[0]
	data, err := fetchGitHubUser(login)
	if err != nil {
		t.Error(err)
		return
	}

	url, ok := data["html_url"]
	if !ok {
		t.Errorf("No URL found for user login %s\n", login)
		return
	}

	t.Logf("The URL for user %s is %s\n", login, url)
}
func TaskGitHubUser ( t * tasking . T ) { if len ( t . Args ) == 0 { t . Error ( " " ) return } login := t . Args [ 0 ] data , err := fetchGitHubUser ( login ) if err != nil { t . Error ( err ) return } url , ok := data [ " " ] if ! ok { t . Errorf ( " \n " , login ) return } t . Logf ( " \n " , login , url ) }
// NAME
//    gh-user - Get URL for a given GitHub user login
//
// DESCRIPTION
//    Given a GitHub user login, call the GitHub API to get this user and print out the user page URL.
//
//    For example
//
//    $ gotask git-hub-user jingweno
//
// OPTIONS
//    --verbose, -v
//        run in verbose mode
NAME gh - user - Get URL for a given GitHub user login DESCRIPTION Given a GitHub user login call the GitHub API to get this user and print out the user page URL . For example $ gotask git - hub - user jingweno OPTIONS -- verbose - v run in verbose mode