You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

21 lines
472 B

package main
import (
"io/ioutil"
)
var dataset map[string][]string
var categDataset []string
func readDataset(path string) {
dataset = make(map[string][]string)
folders, _ := ioutil.ReadDir(path)
for _, folder := range folders {
categDataset = append(categDataset, folder.Name())
folderFiles, _ := ioutil.ReadDir(path + "/" + folder.Name())
for _, file := range folderFiles {
dataset[folder.Name()] = append(dataset[folder.Name()], file.Name())
}
}
}