slice_test.go 209 Bytes Raw Blame History Permalink 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 package utils import ( "testing" ) func TestInSlice(t *testing.T) { sl := []string{"A", "b"} if !InSlice("A", sl) { t.Error("should be true") } if InSlice("B", sl) { t.Error("should be false") } }