remove unused method

master
kevin 4 years ago committed by kingxt
parent 9b0b958f43
commit f77c73eec1

@ -22,8 +22,8 @@ func getParentPackage(dir string) (string, error) {
if err != nil {
return "", err
}
absDir = strings.ReplaceAll(absDir, `\`, `/`)
absDir = strings.ReplaceAll(absDir, `\`, `/`)
var rootPath string
var tempPath = absDir
var hasGoMod = false

@ -4,7 +4,6 @@ import (
"fmt"
"os"
"path"
"path/filepath"
"strings"
"github.com/tal-tech/go-zero/tools/goctl/vars"
@ -44,16 +43,3 @@ func PathFromGoSrc() (string, error) {
// skip slash
return dir[len(parent)+1:], nil
}
func GetParentPackage(dir string) (string, error) {
absDir, err := filepath.Abs(dir)
if err != nil {
return "", err
}
pos := strings.Index(absDir, vars.ProjectName)
if pos < 0 {
return "", fmt.Errorf("error dir:[%s],please make sure that your project is in the %s directory", vars.ProjectName, dir)
}
return absDir[pos:], nil
}

Loading…
Cancel
Save