mirror of
https://github.com/foomo/gotsrpc.git
synced 2025-10-16 12:35:35 +00:00
only reading public methods
This commit is contained in:
parent
6fa5e7a77f
commit
9e3a3b0786
@ -4,6 +4,7 @@ import (
|
||||
"errors"
|
||||
"go/ast"
|
||||
"reflect"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func readServiceFile(file *ast.File, services []*Service) error {
|
||||
@ -29,8 +30,8 @@ func readServiceFile(file *ast.File, services []*Service) error {
|
||||
trace(" on sth:", ident.Name)
|
||||
|
||||
service, ok := findService(ident.Name)
|
||||
|
||||
if ok {
|
||||
firstCharOfMethodName := funcDecl.Name.Name[0:1]
|
||||
if ok && strings.ToLower(firstCharOfMethodName) != firstCharOfMethodName {
|
||||
service.Methods = append(service.Methods, &Method{
|
||||
Name: funcDecl.Name.Name,
|
||||
Args: readFields(funcDecl.Type.Params),
|
||||
|
||||
Loading…
Reference in New Issue
Block a user