summaryrefslogtreecommitdiff
path: root/libgo/go/runtime/string.go
diff options
context:
space:
mode:
Diffstat (limited to 'libgo/go/runtime/string.go')
-rw-r--r--libgo/go/runtime/string.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/libgo/go/runtime/string.go b/libgo/go/runtime/string.go
index 025ea7a3bd7..eac94bf6a8a 100644
--- a/libgo/go/runtime/string.go
+++ b/libgo/go/runtime/string.go
@@ -360,6 +360,10 @@ func hasPrefix(s, prefix string) bool {
return len(s) >= len(prefix) && s[:len(prefix)] == prefix
}
+func hasSuffix(s, suffix string) bool {
+ return len(s) >= len(suffix) && s[len(s)-len(suffix):] == suffix
+}
+
const (
maxUint = ^uint(0)
maxInt = int(maxUint >> 1)