Skip to content

Commit

Permalink
Exclude unions form default values
Browse files Browse the repository at this point in the history
Summary: Union fields should remain uninitialized in the constructor.

Reviewed By: leoleovich

Differential Revision: D45885017

fbshipit-source-id: 384ebffec5b60dd550a6357fb5aaa7eaa6d9cffb
  • Loading branch information
echistyakov authored and facebook-github-bot committed May 17, 2023
1 parent fa232ac commit 57df0a2
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 94 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
}}
func {{struct:go_qualified_new_func}}() *{{struct:go_name}} {
return (&{{struct:go_name}}{}){{!
}}{{^struct:union?}}{{!
}}{{#struct:fields}}{{!
// Fields with given default values.
Expand All @@ -46,6 +47,7 @@ func {{struct:go_qualified_new_func}}() *{{struct:go_name}} {
}}){{/field:optional?}}{{!
}}{{/field:value}}{{!
}}{{/struct:fields}}
}}{{/struct:fields}}{{!
}}{{/struct:union?}}
}
{{!newline}}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 57df0a2

Please sign in to comment.