Lines Matching full:suffix
348 // HasSuffix tests whether the byte slice s ends with suffix.
349 func HasSuffix(s, suffix []byte) bool {
350 return len(s) >= len(suffix) && Equal(s[len(s)-len(suffix):], suffix)
512 // TrimSuffix returns s without the provided trailing suffix string.
513 // If s doesn't end with suffix, s is returned unchanged.
514 func TrimSuffix(s, suffix []byte) []byte {
515 if HasSuffix(s, suffix) {
516 return s[:len(s)-len(suffix)]