package services import ( "fmt" "context" "log" "errors" "google.golang.org/grpc" "encoding/json" User "tldemo/services/User" Common "tldemo/services/Common" ) type UserAddress struct { Address string PostalCode string } type UserData struct { Id int Name string Gender Common.Gender Addresses [] *UserAddress } type UserServer struct { User.UnimplementedUserServiceServer UserArray []*UserData } func (s *UserServer) Register(ctx context.Context, in *User.RegisterRequest) (*Common.RegisterResponse, error) { userData := &UserData{Id:len(s.UserArray), Name:in.Name, Gender:in.Gender} userData.Addresses = make([]*UserAddress, 0) for i:=0; i=len(s.UserArray)) { return nil, errors.New("Out of range!") } var userData = s.UserArray[int(in.Id)] //address := make([]*User.RegisterRequest_Address, 0) //for i:=0; i