24 lines
370 B
Go
24 lines
370 B
Go
package module
|
|
|
|
import (
|
|
"io/ioutil"
|
|
"path"
|
|
"strings"
|
|
)
|
|
|
|
func List(modulesPath string) ([]string, error) {
|
|
files, err := ioutil.ReadDir(modulesPath)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
var res []string
|
|
for _, file := range files {
|
|
if strings.HasSuffix(file.Name(), ".so") {
|
|
res = append(res, path.Join(modulesPath, file.Name()))
|
|
}
|
|
}
|
|
|
|
return res, nil
|
|
}
|