📅  最后修改于: 2022-03-11 14:59:18.890000             🧑  作者: Mango
dir, err := os.Stat(dirName)
if err != nil {
return filesHash, fmt.Errorf("failed to open directory, error: %w", err)
}
if !dir.IsDir() {
return filesHash, fmt.Errorf("%q is not a directory", dir.Name())
}