Skip to content

Commit

Permalink
Increase number-like data types' precision (#36)
Browse files Browse the repository at this point in the history
Co-authored-by: Henrique Santos <[email protected]>
  • Loading branch information
hcsa73 and Henrique Santos authored Oct 23, 2023
1 parent 22450f3 commit ed405e7
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion templates/model_simple.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,18 @@ type {{classname}} struct {
{{#description}}
// {{{.}}}
{{/description}}
{{#isShort}}
// Can be cast to int32 without loss of precision.
{{/isShort}}
{{#isFloat}}
// Can be cast to float32 without loss of precision.
{{/isFloat}}
{{#deprecated}}
// Deprecated
{{/deprecated}}
{{#required}}
// REQUIRED
{{/required}}
{{name}} *{{{dataType}}} `json:"{{baseName}}{{^required}},omitempty{{/required}}"{{#withXml}} xml:"{{baseName}}{{#isXmlAttribute}},attr{{/isXmlAttribute}}"{{/withXml}}{{#vendorExtensions.x-go-custom-tag}} {{{.}}}{{/vendorExtensions.x-go-custom-tag}}`
{{name}} *{{#isNumber}}float64{{/isNumber}}{{#isFloat}}float64{{/isFloat}}{{#isDouble}}float64{{/isDouble}}{{#isInteger}}int64{{/isInteger}}{{#isLong}}int64{{/isLong}}{{^isNumeric}}{{{dataType}}}{{/isNumeric}} `json:"{{baseName}}{{^required}},omitempty{{/required}}"{{#withXml}} xml:"{{baseName}}{{#isXmlAttribute}},attr{{/isXmlAttribute}}"{{/withXml}}{{#vendorExtensions.x-go-custom-tag}} {{{.}}}{{/vendorExtensions.x-go-custom-tag}}`
{{/vars}}
}

0 comments on commit ed405e7

Please sign in to comment.