⛩️ Powerful yet Minimal Nix Dependency Manager
flake flakes home-manager nixos go nix dependency dependencies

refactor(utilities): move lister to utilities

fuwn.net dc4aeba0 49f77d14

verified
+13 -12
-12
source.go
··· 116 116 117 117 return "", fmt.Errorf("source is not a git repository") 118 118 } 119 - 120 - func lister(items []string) string { 121 - if len(items) == 0 { 122 - return "" 123 - } else if len(items) == 1 { 124 - return items[0] 125 - } else if len(items) == 2 { 126 - return fmt.Sprintf("%s & %s", items[0], items[1]) 127 - } 128 - 129 - return fmt.Sprintf("%s, & %s", strings.Join(items[:len(items)-1], ", "), items[len(items)-1]) 130 - }
+13
utilities.go
··· 1 1 package main 2 2 3 3 import ( 4 + "fmt" 4 5 "os" 5 6 "os/exec" 6 7 "strings" ··· 40 41 41 42 return string(out), err 42 43 } 44 + 45 + func lister(items []string) string { 46 + if len(items) == 0 { 47 + return "" 48 + } else if len(items) == 1 { 49 + return items[0] 50 + } else if len(items) == 2 { 51 + return fmt.Sprintf("%s & %s", items[0], items[1]) 52 + } 53 + 54 + return fmt.Sprintf("%s, & %s", strings.Join(items[:len(items)-1], ", "), items[len(items)-1]) 55 + }