Преглед изворни кода

fix bug: module parse error (#97)

Keson пре 4 година
родитељ
комит
a5ce2c448e
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      tools/goctl/util/project/project.go

+ 1 - 1
tools/goctl/util/project/project.go

@@ -133,7 +133,7 @@ func Prepare(projectDir string, checkGrpcEnv bool) (*Project, error) {
 
 func matchModule(data []byte) (string, error) {
 	text := string(data)
-	re := regexp.MustCompile(`(?m)^\s*module\s+[a-z0-9/\-.]+$`)
+	re := regexp.MustCompile(`(?m)^\s*module\s+[a-z0-9_/\-.]+$`)
 	matches := re.FindAllString(text, -1)
 	if len(matches) == 1 {
 		target := matches[0]