remove unused method

master
kevin 4 years ago
parent 7f2e48e8f0
commit a13ab94748

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

@ -4,7 +4,6 @@ import (
"fmt" "fmt"
"os" "os"
"path" "path"
"path/filepath"
"strings" "strings"
"github.com/tal-tech/go-zero/tools/goctl/vars" "github.com/tal-tech/go-zero/tools/goctl/vars"
@ -44,16 +43,3 @@ func PathFromGoSrc() (string, error) {
// skip slash // skip slash
return dir[len(parent)+1:], nil 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