func CheckAndAddCurrency(input []string, check string) []string {
	for _, x := range input {
		if IsDefaultCurrency(x) {
			if IsDefaultCurrency(check) {
				if check == x {
					return input
				}
				continue
			}
			return input
		} else if IsDefaultCryptocurrency(x) {
			if IsDefaultCryptocurrency(check) {
				if check == x {
					return input
				}
				continue
			}
			return input
		}
		return input
	}
	input = append(input, check)
	return input
}
CheckAndAddCurrency checks the string you passed with the input string array,
if not already added, checks to see if it is part of the default currency
list and returns the appended string.
package currency
import (
	"errors"
	"fmt"
	"log"
	"net/url"
	"strings"
	"time"
	"github.com/mattkanwisher/cryptofiend/common"
)
type Rate struct {
	ID   string  `json:"id"`
	Name string  `json:"Name"`
	Rate float64 `json:",string"`
	Date string  `json:"Date"`
	Time string  `json:"Time"`
	Ask  float64 `json:",string"`
	Bid  float64 `json:",string"`
}
type YahooJSONResponseInfo struct {
	Count   int       `json:"count"`
	Created time.Time `json:"created"`
	Lang    string    `json:"lang"`
}
type YahooJSONResponse struct {
	Query struct {
		YahooJSONResponseInfo
		Results struct {
			Rate []Rate `json:"rate"`
		}
	}
}
type FixerResponse struct {
	Base  string             `json:"base"`
	Date  string             `json:"date"`
	Rates map[string]float64 `json:"rates"`
}
const (
	maxCurrencyPairsPerRequest = 350
	yahooYQLURL                = "https://query.yahooapis.com/v1/public/yql?"
	yahooDatabase              = "store://datatables.org/alltableswithkeys"
	fixerAPI                   = "http://api.fixer.io/latest"
	DefaultCurrencies = "USD,AUD,EUR,CNY"
	DefaultCryptoCurrencies = "BTC,LTC,ETH,DOGE,DASH,XRP,XMR"
)
var (
	CurrencyStore             map[string]Rate
	CurrencyStoreFixer        map[string]float64
	BaseCurrencies            string
	CryptoCurrencies          string
	ErrCurrencyDataNotFetched = errors.New("yahoo currency data has not been fetched yet")
	ErrCurrencyNotFound       = errors.New("unable to find specified currency")
	ErrQueryingYahoo          = errors.New("unable to query Yahoo currency values")
	ErrQueryingYahooZeroCount = errors.New("yahoo returned zero currency data")
	YahooEnabled              = false
)
func SetProvider(yahooEnabled bool) {
	if yahooEnabled {
		YahooEnabled = true
		return
	}
	YahooEnabled = false
}
func SwapProvider() {
	if YahooEnabled {
		YahooEnabled = false
		return
	}
	YahooEnabled = true
}
func GetProvider() string {
	if YahooEnabled {
		return "yahoo"
	}
	return "fixer"
}
func IsDefaultCurrency(currency string) bool {
	return common.StringContains(
		DefaultCurrencies, common.StringToUpper(currency),
	)
}
func IsDefaultCryptocurrency(currency string) bool {
	return common.StringContains(
		DefaultCryptoCurrencies, common.StringToUpper(currency),
	)
}
func IsFiatCurrency(currency string) bool {
	if BaseCurrencies == "" {
		log.Println("IsFiatCurrency: BaseCurrencies string variable not populated")
		return false
	}
	return common.StringContains(BaseCurrencies, common.StringToUpper(currency))
}
func IsCryptocurrency(currency string) bool {
	if CryptoCurrencies == "" {
		log.Println(
			"IsCryptocurrency: CryptoCurrencies string variable not populated",
		)
		return false
	}
	return common.StringContains(CryptoCurrencies, common.StringToUpper(currency))
}
func ContainsSeparator(input string) (bool, string) {
	separators := []string{"-", "_"}
	var separatorsContainer []string
	for _, x := range separators {
		if common.StringContains(input, x) {
			separatorsContainer = append(separatorsContainer, x)
		}
	}
	if len(separatorsContainer) == 0 {
		return false, ""
	}
	return true, strings.Join(separatorsContainer, ",")
}
func ContainsBaseCurrencyIndex(baseCurrencies []string, currency string) (bool, string) {
	for _, x := range baseCurrencies {
		if common.StringContains(currency, x) {
			return true, x
		}
	}
	return false, ""
}
func ContainsBaseCurrency(baseCurrencies []string, currency string) bool {
	for _, x := range baseCurrencies {
		if common.StringContains(currency, x) {
			return true
		}
	}
	return false
}