Added function FindFileType

This commit is contained in:
Dmitry Lyukov
2016-03-29 00:24:07 +03:00
parent fb4212043f
commit f4bd34c242

View File

@@ -236,6 +236,10 @@ func GetStatTimesFromDb(db *sql.DB, fromTime int64, keyMap map[uint8]string) []S
return res return res
} }
func FindFileType(path string) string {
}
func main() { func main() {
keyboardID := flag.Int("id", -1, "Your keyboard id") keyboardID := flag.Int("id", -1, "Your keyboard id")
@@ -300,9 +304,8 @@ func main() {
time.Sleep(SLEEP_TIME) time.Sleep(SLEEP_TIME)
} }
case *outputPath != "": case *outputPath != "":
re := regexp.MustCompile("\\.\\S+")
filetype := re.FindString(*outputPath)
exportingData := GetStatTimesFromDb(db, 0, keyMap) exportingData := GetStatTimesFromDb(db, 0, keyMap)
filetype := findFileType(*outputPath)
log.Println(filetype) log.Println(filetype)
switch filetype { switch filetype {
case ".csv": case ".csv":