github.com/TeaOSLab/EdgeNode@v1.3.8/internal/caches/utils_partial.go (about) 1 // Copyright 2022 Liuxiangchao iwind.liu@gmail.com. All rights reserved. 2 3 package caches 4 5 import "strings" 6 7 // PartialRangesFilePath 获取 ranges 文件路径 8 func PartialRangesFilePath(path string) string { 9 // ranges路径 10 var dotIndex = strings.LastIndex(path, ".") 11 var rangePath string 12 if dotIndex < 0 { 13 rangePath = path + "@ranges.cache" 14 } else { 15 rangePath = path[:dotIndex] + "@ranges" + path[dotIndex:] 16 } 17 return rangePath 18 }