tangled
alpha
login
or
join now
fuwn.net
/
yae
0
fork
atom
⛩️ Powerful yet Minimal Nix Dependency Manager
flake
flakes
home-manager
nixos
go
nix
dependency
dependencies
0
fork
atom
overview
issues
pulls
pipelines
refactor(utilities): move lister to utilities
fuwn.net
1 year ago
dc4aeba0
49f77d14
verified
This commit was signed with the committer's
known signature
.
fuwn.net
SSH Key Fingerprint:
SHA256:VPdFPyPbd6JkoMyWUdZ/kkTcIAt3sxjXD2XSAZ7FYC4=
+13
-12
2 changed files
expand all
collapse all
unified
split
source.go
utilities.go
-12
source.go
···
116
116
117
117
return "", fmt.Errorf("source is not a git repository")
118
118
}
119
119
-
120
120
-
func lister(items []string) string {
121
121
-
if len(items) == 0 {
122
122
-
return ""
123
123
-
} else if len(items) == 1 {
124
124
-
return items[0]
125
125
-
} else if len(items) == 2 {
126
126
-
return fmt.Sprintf("%s & %s", items[0], items[1])
127
127
-
}
128
128
-
129
129
-
return fmt.Sprintf("%s, & %s", strings.Join(items[:len(items)-1], ", "), items[len(items)-1])
130
130
-
}
+13
utilities.go
···
1
1
package main
2
2
3
3
import (
4
4
+
"fmt"
4
5
"os"
5
6
"os/exec"
6
7
"strings"
···
40
41
41
42
return string(out), err
42
43
}
44
44
+
45
45
+
func lister(items []string) string {
46
46
+
if len(items) == 0 {
47
47
+
return ""
48
48
+
} else if len(items) == 1 {
49
49
+
return items[0]
50
50
+
} else if len(items) == 2 {
51
51
+
return fmt.Sprintf("%s & %s", items[0], items[1])
52
52
+
}
53
53
+
54
54
+
return fmt.Sprintf("%s, & %s", strings.Join(items[:len(items)-1], ", "), items[len(items)-1])
55
55
+
}