Kevin Wan 1 年之前
父节点
当前提交
14fcbd7658
共有 2 个文件被更改,包括 5 次插入5 次删除
  1. 1 1
      tools/goctl/api/format/format_test.go
  2. 4 4
      tools/goctl/api/parser/g4/ast/apiparser.go

+ 1 - 1
tools/goctl/api/format/format_test.go

@@ -58,7 +58,7 @@ func TestFormat(t *testing.T) {
 	assert.Nil(t, err)
 	assert.Equal(t, formattedStr, r)
 	_, err = apiFormat(notFormattedStr, false)
-	assert.Errorf(t, err, " line 7:13 can not found declaration 'Student' in context")
+	assert.Errorf(t, err, " line 7:13 can not find declaration 'Student' in context")
 }
 
 func Test_apiFormatReader_issue1721(t *testing.T) {

+ 4 - 4
tools/goctl/api/parser/g4/ast/apiparser.go

@@ -420,7 +420,7 @@ func (p *Parser) checkServices(apiItem *Api, types map[string]TypeExpr, linePref
 
 				_, ok := types[structName]
 				if !ok {
-					return fmt.Errorf("%s line %d:%d can not found declaration '%s' in context",
+					return fmt.Errorf("%s line %d:%d can not find declaration '%s' in context",
 						linePrefix, route.Reply.Name.Expr().Line(), route.Reply.Name.Expr().Column(), structName)
 				}
 			}
@@ -433,7 +433,7 @@ func (p *Parser) checkRequestBody(route *Route, types map[string]TypeExpr, lineP
 	if route.Req != nil && route.Req.Name.IsNotNil() && route.Req.Name.Expr().IsNotNil() {
 		_, ok := types[route.Req.Name.Expr().Text()]
 		if !ok {
-			return fmt.Errorf("%s line %d:%d can not found declaration '%s' in context",
+			return fmt.Errorf("%s line %d:%d can not find declaration '%s' in context",
 				linePrefix, route.Req.Name.Expr().Line(), route.Req.Name.Expr().Column(), route.Req.Name.Expr().Text())
 		}
 	}
@@ -470,7 +470,7 @@ func (p *Parser) checkType(linePrefix string, types map[string]TypeExpr, expr Da
 		}
 		_, ok := types[name]
 		if !ok {
-			return fmt.Errorf("%s line %d:%d can not found declaration '%s' in context",
+			return fmt.Errorf("%s line %d:%d can not find declaration '%s' in context",
 				linePrefix, v.Literal.Line(), v.Literal.Column(), name)
 		}
 
@@ -481,7 +481,7 @@ func (p *Parser) checkType(linePrefix string, types map[string]TypeExpr, expr Da
 		}
 		_, ok := types[name]
 		if !ok {
-			return fmt.Errorf("%s line %d:%d can not found declaration '%s' in context",
+			return fmt.Errorf("%s line %d:%d can not find declaration '%s' in context",
 				linePrefix, v.Name.Line(), v.Name.Column(), name)
 		}
 	case *Map: