github.com/u-root/u-root@v7.0.1-0.20200915234505-ad7babab0a8e+incompatible/cmds/core/elvish/util/fullnames_unix_test.go (about) 1 // +build !windows,!plan9 2 3 package util 4 5 import ( 6 "os/exec" 7 "sort" 8 "strings" 9 ) 10 11 func ls(dir string) []string { 12 output, err := exec.Command("ls", dir).Output() 13 mustOK(err) 14 names := strings.Split(strings.Trim(string(output), "\n"), "\n") 15 for i := range names { 16 names[i] = dir + names[i] 17 } 18 sort.Strings(names) 19 return names 20 }