feat: Add Command-line clients link and web page
Signed-off-by: Julien Riou <julien@riou.xyz>
This commit is contained in:
parent
ff92e30232
commit
70d3892b15
7 changed files with 166 additions and 30 deletions
|
@ -117,3 +117,12 @@ func ToLowerStringSlice(src []string) (dst []string) {
|
|||
}
|
||||
return
|
||||
}
|
||||
|
||||
func InSlice(s []string, elem string) bool {
|
||||
for _, v := range s {
|
||||
if v == elem {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
|
|
@ -85,3 +85,25 @@ func TestToLowerStringsSlice(t *testing.T) {
|
|||
t.Logf("got '%s', want '%s'", got, expected)
|
||||
}
|
||||
}
|
||||
|
||||
func TestInSlice(t *testing.T) {
|
||||
tests := []struct {
|
||||
elem string
|
||||
s []string
|
||||
expected bool
|
||||
}{
|
||||
{"linux", []string{"linux", "darwin"}, true},
|
||||
{"windows", []string{"linux", "darwin"}, false},
|
||||
}
|
||||
|
||||
for _, tc := range tests {
|
||||
t.Run(fmt.Sprintf("TestInSlice#%s", tc.elem), func(t *testing.T) {
|
||||
got := InSlice(tc.s, tc.elem)
|
||||
if got != tc.expected {
|
||||
t.Errorf("got '%t', want '%t'", got, tc.expected)
|
||||
} else {
|
||||
t.Logf("got '%t', want '%t'", got, tc.expected)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue