PackageManager just because
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
459 B

  1. package Filesystem
  2. import (
  3. "fmt"
  4. )
  5. func PrintFiles(files []string, color func(...interface{}) string) {
  6. var f string
  7. for _, f = range files {
  8. fmt.Printf("\t%s\n", color(f))
  9. }
  10. }
  11. func PrintFilesLength(files []string) {
  12. fmt.Printf("\t%d files found\n", len(files))
  13. }
  14. func PrintFilesOrLength(files []string, color func(...interface{}) string) {
  15. if len(files) < 25 && len(files) > 0 {
  16. PrintFiles(files, color)
  17. return
  18. }
  19. PrintFilesLength(files)
  20. }