소스 검색

filepath.ToSlash

Michael Yang 1 년 전
부모
커밋
09c0972a6a
1개의 변경된 파일1개의 추가작업 그리고 2개의 파일을 삭제
  1. 1 2
      server/modelpath.go

+ 1 - 2
server/modelpath.go

@@ -49,8 +49,7 @@ func ParseModelPath(name string) ModelPath {
 		name = after
 	}
 
-	name = strings.ReplaceAll(name, string(os.PathSeparator), "/")
-	parts := strings.Split(name, "/")
+	parts := strings.Split(filepath.ToSlash(name), "/")
 	switch len(parts) {
 	case 3:
 		mp.Registry = parts[0]