Skip to content

Commit 33eb293

Browse files
kingxtkingxt
and
kingxt
authored
fix: root path on windows bug (#34)
* rebase upstream * rebase * trim no need line * trim no need line * trim no need line * fix bug on windows Co-authored-by: kingxt <[email protected]>
1 parent b7a018b commit 33eb293

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/goctl/util/path.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ func FindGoModPath(dir string) (string, bool) {
6161
for {
6262
if FileExists(filepath.Join(tempPath, goModeIdentifier)) {
6363
tempPath = filepath.Dir(tempPath)
64-
rootPath = absDir[len(tempPath)+1:]
64+
rootPath = strings.TrimPrefix(absDir[len(tempPath):], "/")
6565
hasGoMod = true
6666
break
6767
}

0 commit comments

Comments
 (0)