File tree Expand file tree Collapse file tree 2 files changed +20
-18
lines changed
Expand file tree Collapse file tree 2 files changed +20
-18
lines changed Original file line number Diff line number Diff line change 1+ package lister
2+
3+ import "strings"
4+
5+ func isBlacklisted (blacklist []string , name string ) bool {
6+ for _ , blacklistedName := range blacklist {
7+ if strings .EqualFold (blacklistedName , name ) {
8+ return true
9+ }
10+ }
11+ return false
12+ }
13+
14+ func createBlacklistSet (blacklist []string ) map [string ]struct {} {
15+ blacklistSet := make (map [string ]struct {}, len (blacklist ))
16+ for _ , name := range blacklist {
17+ blacklistSet [name ] = struct {}{}
18+ }
19+ return blacklistSet
20+ }
Original file line number Diff line number Diff line change @@ -2,7 +2,6 @@ package lister
22
33import (
44 "fmt"
5- "strings"
65
76 "github.com/joshmedeski/sesh/model"
87)
@@ -11,23 +10,6 @@ func tmuxKey(name string) string {
1110 return fmt .Sprintf ("tmux:%s" , name )
1211}
1312
14- func isBlacklisted (blacklist []string , name string ) bool {
15- for _ , blacklistedName := range blacklist {
16- if strings .EqualFold (blacklistedName , name ) {
17- return true
18- }
19- }
20- return false
21- }
22-
23- func createBlacklistSet (blacklist []string ) map [string ]struct {} {
24- blacklistSet := make (map [string ]struct {}, len (blacklist ))
25- for _ , name := range blacklist {
26- blacklistSet [name ] = struct {}{}
27- }
28- return blacklistSet
29- }
30-
3113func listTmux (l * RealLister ) (model.SeshSessions , error ) {
3214 tmuxSessions , err := l .tmux .ListSessions ()
3315 if err != nil {
You can’t perform that action at this time.
0 commit comments