diff --git a/modules/openapi-generator/src/main/resources/go/model_anyof.mustache b/modules/openapi-generator/src/main/resources/go/model_anyof.mustache index 5bdefe2a9e2..f1d8c57c85f 100644 --- a/modules/openapi-generator/src/main/resources/go/model_anyof.mustache +++ b/modules/openapi-generator/src/main/resources/go/model_anyof.mustache @@ -20,7 +20,7 @@ func (dst *{{classname}}) UnmarshalJSON(data []byte) error { {{#-first}} // use discriminator value to speed up the lookup var jsonDict map[string]interface{} - err := json.Unmarshal(data, &jsonDict) + err = json.Unmarshal(data, &jsonDict) if err != nil { return fmt.Errorf("Failed to unmarshal JSON into map for the discriminator lookup.") }