mirror of
https://github.com/zeromicro/go-zero.git
synced 2026-05-11 00:40:00 +08:00
feat(goctl/rpc): support external proto imports with cross-package ty… (#5472)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -2,9 +2,6 @@ package parser
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"github.com/emicklei/proto"
|
||||
)
|
||||
@@ -35,20 +32,5 @@ func (s Services) validate(filename string, multipleOpt ...bool) error {
|
||||
return errors.New("only one service expected")
|
||||
}
|
||||
|
||||
name := filepath.Base(filename)
|
||||
for _, service := range s {
|
||||
for _, rpc := range service.RPC {
|
||||
if strings.Contains(rpc.RequestType, ".") {
|
||||
return fmt.Errorf("line %v:%v, request type must defined in %s",
|
||||
rpc.Position.Line,
|
||||
rpc.Position.Column, name)
|
||||
}
|
||||
if strings.Contains(rpc.ReturnsType, ".") {
|
||||
return fmt.Errorf("line %v:%v, returns type must defined in %s",
|
||||
rpc.Position.Line,
|
||||
rpc.Position.Column, name)
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user