pulumi/pkg/codegen/go
Will Jones cee6e49bf8
Clean up and test PCL object type annotations
In our model of PCL based on HCL syntax, we define a number of types
according to Pulumi's type system. Among these is `ObjectType`, the type
of objects of the form `{ k_1: t_1, ..., k_n: t_n }`, where each key
`k_i` maps to a nested type `t_i`. Object types crop up all over the
place -- as sets of resource input properties, resource outputs
themselves, and as arguments to function calls, for instance.

Because object types are so prevalent, it is often useful to be able to
link them to metadata about their intended use. For instance, in code
generation, we might like to know if an object type corresponds to a
"bare" object literal or an instance of some named class. To this end,
object types support _annotations_, and such annotations are used in
e.g. .Net and Python codegen as hinted above.

In preparation for making wider use of annotations (e.g. for adding
`call` to PCL, which requires us to know about expressions' linked
resource types), this change cleans up the interface for working with
annotations and adds a number of test cases. Additionally, code that is
likely currently brittle due to only checking the first of a set of
annotations (see the various uses of `[0]` in the diff) has been made
more robust, possibly fixing some rare bugs/edge cases.

Working towards closing pulumi/pulumi-java#262
2025-01-10 16:58:48 +00:00
..
gen_program_test Don't publish test code in `pkg/codegen` (#17517) 2024-10-09 11:09:54 +00:00
doc.go Enable perfsprint linter (#14813) 2023-12-12 12:19:42 +00:00
doc_test.go sdk/go: Remove 'nolint' directives from package docs 2023-01-06 09:06:47 -08:00
embeddedUtilities.go Support returning plain values from methods (#13592) 2023-11-18 06:02:06 +00:00
gen.go Automatically bridge eligible dependencies on pulumi convert from terraform (#17992) 2024-12-23 13:35:55 +00:00
gen_program.go Clean up and test PCL object type annotations 2025-01-10 16:58:48 +00:00
gen_program_expression_test.go Enable goheader rule and add missing license headers (#15473) 2024-09-09 12:05:45 +00:00
gen_program_expressions.go Clean up and test PCL object type annotations 2025-01-10 16:58:48 +00:00
gen_program_inline_invoke.go Enable goheader rule and add missing license headers (#15473) 2024-09-09 12:05:45 +00:00
gen_program_json.go Enable goheader rule and add missing license headers (#15473) 2024-09-09 12:05:45 +00:00
gen_program_optionals.go Enable goheader rule and add missing license headers (#15473) 2024-09-09 12:05:45 +00:00
gen_program_read_dir.go Enable goheader rule and add missing license headers (#15473) 2024-09-09 12:05:45 +00:00
gen_program_splat.go Enable goheader rule and add missing license headers (#15473) 2024-09-09 12:05:45 +00:00
gen_program_ternaries.go Enable goheader rule and add missing license headers (#15473) 2024-09-09 12:05:45 +00:00
gen_program_test.go [sdk/program-gen] Implementing DeferredOutput for Go SDK and program-gen (#17885) 2025-01-04 18:47:30 +00:00
gen_program_utils.go Enable goheader rule and add missing license headers (#15473) 2024-09-09 12:05:45 +00:00
gen_spill.go Enable goheader rule and add missing license headers (#15473) 2024-09-09 12:05:45 +00:00
gen_test.go Enable goheader rule and add missing license headers (#15473) 2024-09-09 12:05:45 +00:00
importer.go [go/program-gen] Implement importPathPattern in Go language options to override emitted paths in generated Go programs (#16267) 2024-05-30 19:51:12 +00:00
utilities.go Enable perfsprint linter (#14813) 2023-12-12 12:19:42 +00:00
utilities_test.go Enable goheader rule and add missing license headers (#15473) 2024-09-09 12:05:45 +00:00