diff --git a/dingotest/dingo.yml b/dingotest/dingo.yml index df4748c..405cda4 100644 --- a/dingotest/dingo.yml +++ b/dingotest/dingo.yml @@ -90,3 +90,18 @@ services: type: '*HTTPSignerClient' properties: CreateSigner: '@{Signer}' + + CustomerWelcomePrototype: + type: '*CustomerWelcome' + returns: NewCustomerWelcome(@{SendEmail}) + arguments: + appid: 'string' + scope: 'prototype' + CustomerWelcomePrototype2: + type: '*CustomerWelcome' + returns: NewCustomerWelcome(@{SendEmail}) + arguments: + canaryConfig: '*v1.ObjectMetaAccessor' + scope: 'prototype' + import: + - 'k8s.io/apimachinery/pkg/apis/meta/v1' \ No newline at end of file diff --git a/service.go b/service.go index aa1665c..c5416b8 100644 --- a/service.go +++ b/service.go @@ -182,6 +182,9 @@ func (service *Service) astFunctionBody(file *File, services Services, name, ser if name != "" && service.Scope == ScopePrototype { var arguments []string for _, dep := range service.Returns.Dependencies() { + if dep[len(dep)-1:]!=")" { + dep = dep+"()" + } arguments = append(arguments, fmt.Sprintf("container.Get%s", dep)) } arguments = append(arguments, service.Arguments.Names()...) diff --git a/type.go b/type.go index 253bd5a..2e69c2e 100644 --- a/type.go +++ b/type.go @@ -60,7 +60,9 @@ func (ty Type) LocalPackageName() string { pkgNameParts := strings.Split(ty.UnversionedPackageName(), "/") lastPart := pkgNameParts[len(pkgNameParts)-1] - + if lastPart == "" { + lastPart = ty.PackageName() + } return strings.Replace(lastPart, "-", "_", -1) }