MCPcopy Create free account
hub / github.com/github/gh-aw / indexOf

Function indexOf

pkg/workflow/action_cache_test.go:198–205  ·  view source on GitHub ↗

indexOf returns the index of substr in s, or -1 if not found

(s, substr string)

Source from the content-addressed store, hash-verified

196
197// indexOf returns the index of substr in s, or -1 if not found
198func indexOf(s, substr string) int {
199 for i := 0; i <= len(s)-len(substr); i++ {
200 if s[i:i+len(substr)] == substr {
201 return i
202 }
203 }
204 return -1
205}
206
207func TestActionCacheEmptySaveDoesNotCreateFile(t *testing.T) {
208 // Create temporary directory for testing

Calls

no outgoing calls

Tested by

no test coverage detected