diff --git a/gowsdl_test.go b/gowsdl_test.go index 639d0ed..bce6f2e 100644 --- a/gowsdl_test.go +++ b/gowsdl_test.go @@ -165,7 +165,7 @@ func TestDateTimeType(t *testing.T) { t.Fatal(err) } - expected := `type StartDate soap.XSDDateTime` + expected := `type StartDate = soap.XSDDateTime` if actual != expected { t.Error("got \n" + actual + " want \n" + expected) diff --git a/types_tmpl.go b/types_tmpl.go index e5221d8..18512ac 100644 --- a/types_tmpl.go +++ b/types_tmpl.go @@ -150,7 +150,7 @@ var typesTmpl = ` {{else}} type {{$typeName}} interface{} {{end}} - + {{if .Restriction.Enumeration}} const ( {{with .Restriction}} @@ -164,7 +164,7 @@ var typesTmpl = ` {{else}} {{$type := toGoType .Type .Nillable | removePointerFromType}} {{if ne ($typeName) ($type)}} - type {{$typeName}} {{$type}} + type {{$typeName}} = {{$type}} {{if eq ($type) ("soap.XSDDateTime")}} func (xdt {{$typeName}}) MarshalXML(e *xml.Encoder, start xml.StartElement) error { return soap.XSDDateTime(xdt).MarshalXML(e, start)