alist/pkg/utils/balance.go

19 lines
357 B
Go
Raw Normal View History

2022-06-10 08:49:52 +00:00
package utils
import "strings"
var balance = ".balance"
func IsBalance(str string) bool {
return strings.Contains(str, balance)
}
// GetActualMountPath remove balance suffix
func GetActualMountPath(mountPath string) string {
bIndex := strings.LastIndex(mountPath, ".balance")
2022-06-10 08:49:52 +00:00
if bIndex != -1 {
mountPath = mountPath[:bIndex]
2022-06-10 08:49:52 +00:00
}
return mountPath
2022-06-10 08:49:52 +00:00
}