列出当前目录中的所有文件夹
package main
import (
"fmt"
"io/ioutil"
)
func main() {
files, err := ioutil.ReadDir(".")
if err != nil {
panic(err)
}
fmt.Println("Folders in the current directory:")
for _, fileInfo := range files {
if fileInfo.IsDir() {
fmt.Println(fileInfo.Name())
}
}
}