Directory content

Report a typo

The task folder contains a list of files. A slice with a list of files gets generated by the hidden function named getFileNames().

You need to get each file from the fileNames slice and print each file's info: Mode() IsDir() fileName. For example:

-r--r--r-- true test
Write a program in Go
package main

import (
"fmt"
"log"
"os"
)

func main() {
// DO NOT delete the code line below! It returns a slice with the list of files:
fileNames := getFileNames()

for _, fileName := range fileNames {
fileInfo, ? := ?
if err != nil {
log.Fatal(err)
}
fmt.Printf("%s %5t %s\n", ?, ?, ?)
}
}
___

Create a free account to access the full topic