package common import "fmt" // DataTypeToInt converts the config string value into an int func DataTypeToInt(dataType string) (int64, error) { switch dataType { case CandleStr: return DataCandle, nil case TradeStr: return DataTrade, nil default: return 0, fmt.Errorf("unrecognised dataType '%v'", dataType) } }