func GetToken(organization string) (string, error) {
	var filename string
	var f io.ReadCloser
	var err error
	checkedLocations := make([]string, 1)
	if cfg, ok := os.LookupEnv("XDG_CONFIG_HOME"); ok {
		filename = filepath.Join(cfg, "travis")
		f, err = os.Open(filename)
		checkedLocations[0] = filename
	} else {
		var homeDir string
		user, userErr := user.Current()
		if userErr == nil {
			homeDir = user.HomeDir
		} else {
			homeDir = os.Getenv("HOME")
		}
		filename = filepath.Join(homeDir, "cfg", "travis")
		f, err = os.Open(filename)
		checkedLocations[0] = filename
		if err != nil {  
			rcFilename := filepath.Join(homeDir, ".travis")
			f, err = os.Open(rcFilename)
			checkedLocations = append(checkedLocations, rcFilename)
		}
	}
	if err != nil {
		err = fmt.Errorf(`Couldn't find a config file in %s.
Add a configuration file with your Travis token, like this:
[organizations]
    [organizations.kevinburke]
    token = "aabbccddeeff00"
Go to https://travis-ci.org/profile/<your-username> if you need to find your token.
`, strings.Join(checkedLocations, " or "))
		return "", err
	}
	defer f.Close()
	var c FileConfig
	_, err = toml.DecodeReader(bufio.NewReader(f), &c)
	if err != nil {
		return "", err
	}
	org, ok := getCaseInsensitiveOrg(organization, c.Organizations)
	if ok {
		return org.Token, nil
	}
	if c.Default != "" {
		defaultOrg, ok := getCaseInsensitiveOrg(c.Default, c.Organizations)
		if ok {
			return defaultOrg.Token, nil
		}
		return "", fmt.Errorf(`Couldn't find organization %s in the config.
Go to https: 
`, organization)
	}
	return "", fmt.Errorf(`Couldn't find organization %s in the config.
Set one of your organizations to be the default:
default = "kevinburke"
[organizations]
    [organizations.kevinburke]
    token = "abcdef-bcd-fgh"
Or go to https: 
`, organization)
}
GetToken looks in a config file for the Travis API token. organization is
your Github username ("kevinburke") or organization ("golang").
package travis
import (
	"bufio"
	"context"
	"encoding/json"
	"fmt"
	"io"
	"io/ioutil"
	"net/http"
	"net/url"
	"os"
	"os/user"
	"path/filepath"
	"regexp"
	"strconv"
	"strings"
	"time"
	"github.com/BurntSushi/toml"
	git "github.com/kevinburke/go-git"
	types "github.com/kevinburke/go-types"
	"github.com/kevinburke/rest"
	"github.com/knq/ini"
	colorable "github.com/mattn/go-colorable"
	"golang.org/x/crypto/ssh/terminal"
	"golang.org/x/sync/errgroup"
)