pulumi/pkg/codegen/go
Justin Van Patten a9f0aead13
[codegen/go] Fix Go resource registrations (#6641)
We've been emitting calls to `New<Resource>` for resource registrations
in Go, passing `nil` for args. However, some of those `New<Resource>`
functions actually check for `nil` args and return an error if the
resource has required arguments.

At first, I was looking for a way to check inside `New<Resource>` if
the `URN` option was specified and in that case not error on
`nil` args (like we do in other languages), but we don't provide a way
to access the resource option values outside the Go SDK), so I don't
think there is a way to do it this way for Go.

So instead, this change updates the registration code to call
`ctx.RegisterResource` directly instead of `New<Resource>`, where we can
pass a `nil` args.
2021-03-31 16:50:30 -06:00
..
doc.go [codegen/*] - Fix enum names that start with an underscore. (#5950) 2020-12-16 09:22:44 -08:00
doc_test.go [codegen/schema] - Expand ObjectTypeSpec to ComplexTypeSpec (#5379) 2020-09-16 13:47:40 -07:00
gen.go [codegen/go] Fix Go resource registrations (#6641) 2021-03-31 16:50:30 -06:00
gen_crd2pulumi.go Option to generate container types resources now specified in GoPackageInfo 2021-01-20 11:29:01 -08:00
gen_program.go Fix base import path handling in go programgen 2021-01-20 16:04:33 -08:00
gen_program_expression_test.go Ensure top-level precedence to avoid flaky tests (#5508) 2020-10-05 19:50:51 +02:00
gen_program_expressions.go Handle aliases correctly for invokes 2020-10-05 22:57:00 -07:00
gen_program_inputs.go [Go Program Gen] multiline strings, get/lookup disambiguation, webserver example (#4850) 2020-06-18 13:34:22 -07:00
gen_program_json.go [Go Program Gen] Improved type handling and invokes (#4749) 2020-06-05 18:52:00 -07:00
gen_program_optionals.go go program gen: lift expressions where prompt optionals are required (#4875) 2020-06-23 10:59:26 -07:00
gen_program_read_dir.go Go program gen: resource range, readDir, template strings, etc (#4818) 2020-06-15 23:00:02 -07:00
gen_program_splat.go [Go Program Gen] Support for EKS example (#4831) 2020-06-17 17:19:39 -07:00
gen_program_ternaries.go [Go Program Gen] Improved type handling and invokes (#4749) 2020-06-05 18:52:00 -07:00
gen_program_test.go traverse object and tuple cons expressions for imports 2020-08-05 15:23:36 -07:00
gen_program_utils.go go program gen: prompt array conversion, unused range vars, id handling (#4884) 2020-06-24 11:07:26 -07:00
gen_test.go Fix comment/example handling 2021-03-30 22:24:45 -07:00
importer.go Option to generate container types resources now specified in GoPackageInfo 2021-01-20 11:29:01 -08:00
utilities.go [codegen/*] - Fix enum names that start with an underscore. (#5950) 2020-12-16 09:22:44 -08:00
utilities_test.go [codegen/*] - Fix enum names that start with an underscore. (#5950) 2020-12-16 09:22:44 -08:00