Merge branch 'release/v0.5.0' into change-detection

This commit is contained in:
Svilen Markov
2024-05-30 22:55:01 +01:00
committed by GitHub
44 changed files with 1428 additions and 177 deletions

View File

@@ -79,8 +79,19 @@ func maybeCopySliceWithoutZeroValues[T int | float64](values []T) []T {
return values
}
var urlSchemePattern = regexp.MustCompile(`^[a-z]+:\/\/`)
func stripURLScheme(url string) string {
return urlSchemePattern.ReplaceAllString(url, "")
}
func limitStringLength(s string, max int) (string, bool) {
asRunes := []rune(s)
if len(asRunes) > max {
return string(asRunes[:max]), true
}
return s, false
}