From 53af6abd8cf7533612329f58bc9b4918549aea9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=BCdiger=20Schmitz?= <152157960+bahkauv70@users.noreply.github.com> Date: Thu, 16 Jan 2025 11:30:39 +0100 Subject: [PATCH] fix: correctly handle nillable attributes --- templates/go/model_simple.mustache | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/go/model_simple.mustache b/templates/go/model_simple.mustache index 99b1b6c..566506c 100644 --- a/templates/go/model_simple.mustache +++ b/templates/go/model_simple.mustache @@ -130,7 +130,7 @@ func (o *{{classname}}) Get{{name}}() *{{#isNumber}}float64{{/isNumber}}{{#isFlo return o.{{name}} {{/vendorExtensions.x-golang-is-container}} {{^vendorExtensions.x-golang-is-container}} - return *o.{{name}}.Get() + return o.{{name}}.Get() {{/vendorExtensions.x-golang-is-container}} {{/isNullable}} {{^isNullable}} @@ -181,7 +181,7 @@ func (o *{{classname}}) Set{{name}}(v *{{#isNumber}}float64{{/isNumber}}{{#isFlo if IsNil(o.{{name}}) { o.{{name}} = new({{dataType}}) } - o.{{name}}.Set(&v) + o.{{name}}.Set(v) {{/vendorExtensions.x-golang-is-container}} {{/isNullable}} {{^isNullable}}