How would I unit test a function that does not return anything?
This is an example function:
package main
import (
"fmt"
"log"
"os/exec"
)
func listFilesAndFolders() {
cmd, err := exec.Command("ls", "-l").Output()
if err != nil {
log.Fatal(err)
}
fmt.Println(string(cmd))
fmt.Println("Function executed")
}
func main() {
listFilesAndFolders()
}