fix command run path bug (#52)
* rebase upstream * rebase * trim no need line * trim no need line * trim no need line * optimized go path logic Co-authored-by: kingxt <dream4kingxt@163.com>
This commit is contained in:
@@ -19,6 +19,7 @@ func getParentPackage(dir string) (string, error) {
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
if len(p.GoMod.Path) > 0 {
|
||||
goModePath := filepath.Clean(filepath.Dir(p.GoMod.Path))
|
||||
absPath, err := filepath.Abs(dir)
|
||||
@@ -30,7 +31,7 @@ func getParentPackage(dir string) (string, error) {
|
||||
return parent, nil
|
||||
}
|
||||
|
||||
return p.GoMod.Module, nil
|
||||
return p.Package, nil
|
||||
}
|
||||
|
||||
func writeIndent(writer io.Writer, indent int) {
|
||||
|
||||
Reference in New Issue
Block a user