From 25d3882056f616557fad86e763ca6d39d5d61b6c Mon Sep 17 00:00:00 2001 From: Alancere <804873052@qq.com> Date: Thu, 27 Apr 2023 16:58:37 +0800 Subject: [PATCH] fix --- eng/tools/generator/cmd/v2/common/fileProcessor.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/tools/generator/cmd/v2/common/fileProcessor.go b/eng/tools/generator/cmd/v2/common/fileProcessor.go index 6b8730746ae6..1636f36bbe5c 100644 --- a/eng/tools/generator/cmd/v2/common/fileProcessor.go +++ b/eng/tools/generator/cmd/v2/common/fileProcessor.go @@ -94,9 +94,9 @@ func ReadV2ModuleNameToGetNamespace(path string) (map[string][]PackageInfo, erro return nil, fmt.Errorf("last `track2` section does not properly end") } - s := strings.ReplaceAll(path, "\\", "/") - s1 := strings.Split(s, "/") - specName := s1[len(s1)-3] + _, after, _ := strings.Cut(strings.ReplaceAll(path, "\\", "/"), "specification") + before, _, _ := strings.Cut(after, "resource-manager") + specName := strings.Trim(before, "/") for i := range start { // get the content of the `track2` section