docstore/pkg/store/helper.go
2021-02-18 22:52:36 +01:00

11 lines
264 B
Go

// Copyright (C) 2021 Marius Schellenberger
package store
// Parts taken from strings.TrimPrefix
func hasTrimPrefix(s, prefix string) (string, bool) {
if len(s) >= len(prefix) && s[0:len(prefix)] == prefix {
return s[len(prefix):], true
}
return s, false
}