feat: Add Command-line clients link and web page

Signed-off-by: Julien Riou <julien@riou.xyz>
This commit is contained in:
Julien Riou 2025-09-20 06:36:28 +02:00
commit 70d3892b15
Signed by: jriou
GPG key ID: 9A099EDA51316854
7 changed files with 166 additions and 30 deletions

View file

@ -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
}

View file

@ -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)
}
})
}
}