diff --git a/tools/goctl/api/format/format_test.go b/tools/goctl/api/format/format_test.go index da49bf1c..075ac69a 100644 --- a/tools/goctl/api/format/format_test.go +++ b/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) { diff --git a/tools/goctl/api/parser/g4/ast/apiparser.go b/tools/goctl/api/parser/g4/ast/apiparser.go index 890ba002..f5c66ae0 100644 --- a/tools/goctl/api/parser/g4/ast/apiparser.go +++ b/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: