Bug fix: for compare known, on windows, use "\" instead of "/" (#115)

* Enhancement: Subdir detect runtime os. If windows changes "\" to "/"

* Bug fix: for compare known, on windows, use "\" instead of "/"

* Bug fix: for compare known, on windows, use "\" instead of "/"

Co-authored-by: c0feec0der <>
This commit is contained in:
coffee coder 2020-06-09 05:19:31 +07:00 committed by GitHub
parent 9e88f6d38d
commit 15c0828a2f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -202,7 +202,7 @@ func checkLegacyNameTaken(legacyName string, pkgName string) (bool, error) {
func known(deps map[string]deps.Dependency, p string) bool {
p = filepath.ToSlash(p)
for _, d := range deps {
k := d.Name()
k := filepath.ToSlash(d.Name())
if strings.HasPrefix(p, k) || strings.HasPrefix(k, p) {
return true
}