Golang获取目录下的文件

5年以前  |  阅读数:729 次  |  编程语言:Golang 
package utils

import (
    "io/ioutil"
    "os"
    "path/filepath"
    "strings"
)

func GetFiles(folder string) []os.FileInfo {
    files, _ := ioutil.ReadDir(folder)
    return files
}

Copyright© 2013-2020

All Rights Reserved 京ICP备2023019179号-8