We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 88dab22 commit 73f50d6Copy full SHA for 73f50d6
2 files changed
pkg/workflow/helpers_test.go
@@ -0,0 +1,21 @@
1
+//go:build !integration
2
+
3
+package workflow
4
5
+// contains checks if a string contains a substring.
6
+// Deprecated: prefer strings.Contains or assert.Contains in new tests.
7
+func contains(s, substr string) bool {
8
+ return len(s) >= len(substr) && (s == substr || len(substr) == 0 ||
9
+ (len(s) > len(substr) && s[len(s)-len(substr):] == substr) ||
10
+ (len(s) > len(substr) && s[:len(substr)] == substr) ||
11
+ (len(s) > len(substr) && findSubstring(s, substr)))
12
+}
13
14
+func findSubstring(s, substr string) bool {
15
+ for i := 0; i <= len(s)-len(substr); i++ {
16
+ if s[i:i+len(substr)] == substr {
17
+ return true
18
+ }
19
20
+ return false
21
0 commit comments