列出當前目錄中的所有資料夾
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())
}
}
}