Update all new Tasks
This commit is contained in:
parent
00a190b0a6
commit
91df62d461
5697 changed files with 93386 additions and 804 deletions
24
Task/Unix-ls/Go/unix-ls.go
Normal file
24
Task/Unix-ls/Go/unix-ls.go
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
"sort"
|
||||
)
|
||||
|
||||
func main() {
|
||||
f, err := os.Open(".")
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
files, err := f.Readdirnames(0)
|
||||
f.Close()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
sort.Strings(files)
|
||||
for _, n := range files {
|
||||
fmt.Println(n)
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue