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.

25 lines
537 B

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