pulumi/sdk/go/common/util/mapper
Pat Gavlin b278d4baa9
[utils] Handle nils in mapper encoding (#9810)
* [utils] Handle nils in mapper encoding

The mapper was not handling nil values correctly during encoding. When
attempting to encode a nil `reflect.Value`, the mapper was converting it
to a nil `interface{}`, then taking the `reflect.ValueOf` that interface
value, leading to an invalid `reflect.Value` that tripped an assertion.
These changes avoid the intermediate `interface{}` and consequent
invalid `reflect.Value`.

Contributes to https://github.com/pulumi/pulumi-command/issues/41 and
https://github.com/pulumi/pulumi-command/issues/68.

* Add test

* CL

Co-authored-by: Ian Wahbe <ian@wahbe.com>
2022-06-16 15:43:23 -07:00
..
errors.go move pkg/util/mapper -> sdk/go/common/util/mapper 2020-03-18 14:47:37 -07:00
mapper.go [breaking] Changing the version of go.mod in sdk / pkg to be v3 2021-04-14 19:32:18 +01:00
mapper_decode.go [utils] Handle nils in mapper encoding (#9810) 2022-06-16 15:43:23 -07:00
mapper_encode.go [utils] Handle nils in mapper encoding (#9810) 2022-06-16 15:43:23 -07:00
mapper_test.go [utils] Handle nils in mapper encoding (#9810) 2022-06-16 15:43:23 -07:00
object.go move pkg/util/mapper -> sdk/go/common/util/mapper 2020-03-18 14:47:37 -07:00