From a9754b16886fffa1b3332bb1cd2bc18aa4d665e3 Mon Sep 17 00:00:00 2001 From: haiyux Date: Fri, 26 May 2023 22:21:05 +0800 Subject: [PATCH] fix: windows path failed where use --nomod --- cmd/kratos/internal/project/project.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/kratos/internal/project/project.go b/cmd/kratos/internal/project/project.go index 44d3ead91..3e6eec1ee 100644 --- a/cmd/kratos/internal/project/project.go +++ b/cmd/kratos/internal/project/project.go @@ -84,7 +84,7 @@ func run(_ *cobra.Command, args []string) { panic(e) } // Get the relative path for adding a project based on Go modules - p.Path = filepath.Join(strings.TrimPrefix(workingDir, projectRoot+"/"), p.Name) + p.Path = filepath.ToSlash(filepath.Join(strings.TrimPrefix(filepath.ToSlash(workingDir), filepath.ToSlash(projectRoot)+"/"), p.Name)) done <- p.Add(ctx, workingDir, repoURL, branch, mod) }() select {