os:direntNamePtr for array

This commit is contained in:
luoliwoshang
2025-06-26 10:20:16 +08:00
parent f0728c4fe0
commit 417a5692e3
2 changed files with 27 additions and 0 deletions

19
_demo/readdir/main.go Normal file
View File

@@ -0,0 +1,19 @@
package main
import (
"fmt"
"os"
)
func main() {
entries, err := os.ReadDir("../")
if err != nil {
panic(err)
}
if len(entries) == 0 {
panic("No files found")
}
for _, e := range entries {
fmt.Printf("%s isDir[%t]\n", e.Name(), e.IsDir())
}
}