From 96480c11ee42202303aeb28ec12243d2fe89b6f0 Mon Sep 17 00:00:00 2001 From: haiyux Date: Fri, 19 May 2023 14:19:18 +0800 Subject: [PATCH] fix: fix go import path when add project --nomod (#2837) --- cmd/kratos/internal/project/project.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmd/kratos/internal/project/project.go b/cmd/kratos/internal/project/project.go index fffa0fdc1..44d3ead91 100644 --- a/cmd/kratos/internal/project/project.go +++ b/cmd/kratos/internal/project/project.go @@ -83,6 +83,8 @@ func run(_ *cobra.Command, args []string) { if e != nil { panic(e) } + // Get the relative path for adding a project based on Go modules + p.Path = filepath.Join(strings.TrimPrefix(workingDir, projectRoot+"/"), p.Name) done <- p.Add(ctx, workingDir, repoURL, branch, mod) }() select {