|
|
|
|
|
by shakna
404 days ago
|
|
listFiles is not sorted. It provides the files in the order that the OS provides them. That it's ordered on your machine, probably has to do with when the underlying nodes were created. But that's not going to much work in production. dirInfo, err := dir.Readdir(0)
if err != nil {
return nil, err
}
names := make([]string, len(dirInfo))
for i, fileInfo := range dirInfo {
names[i] = fileInfo.Name()
}
|
|
Edit: after looking more closely at sprig, the solve was sortAlpha