MCPcopy Create free account
hub / github.com/AudDMusic/RedditBot / distance

Function distance

main.go:962–969  ·  view source on GitHub ↗
(s, sub1, sub2 string)

Source from the content-addressed store, hash-verified

960}
961
962func distance(s, sub1, sub2 string) (int, bool) {
963 i1 := strings.Index(s, sub1)
964 i2 := strings.Index(s, sub2)
965 if i1 == -1 || i2 == -1 {
966 return 0, false
967 }
968 return i2 - i1, true
969}
970
971func minDistance(s, sub1 string, sub2 ...string) int {
972 if !strings.Contains(s, sub1) {

Callers 1

minDistanceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected