Welcome to mirror list, hosted at ThFree Co, Russian Federation.

prefix.go « vfilepath « internal « govendor « kardianos « github.com « vendor - gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: c736fe8d3f34ce1c3be9258b3de66c505cac61b9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
package vfilepath

import "strings"

func HasPrefixDir(path string, prefix string) bool {
	return strings.HasPrefix(makeDirPath(path), makeDirPath(prefix))
}

func makeDirPath(path string) string {
	if path != "/" {
		path += "/"
	}
	return path
}