Fixes https://github.com/pulumi/pulumi/issues/13117
This adds a new "--strict" flag to `pulumi convert` which defaults to
false. When strict is NOT set we bind the PCL with the extra options of
`SkipResourceTypechecking`, `AllowMissingVariables`, and
`AllowMissingProperties`. This will change some errors to warnings in
code generation.
The `strict` flag is sent over the gRPC interface to the Go/Node plugins
for their `GenerateProject` methods as they have to do PCL binding
plugin side currently.
govet includes a nilness linter that detects a few nil issues.
This linter is not enabled by default in govet because the `go` tool
does not want a dependency on the libraries necessary to implement this
(golang/go#59714).
Enable the nilness linter and fix the following issues found by it
(commentary below each check mine):
pkg/cmd/pulumi/new.go:283:9: nilness: impossible condition: nil != nil (govet)
^- the error was very likely supposed to be the `os.Remove`
pkg/cmd/pulumi/new.go:633:10: nilness: impossible condition: nil != nil (govet)
^- same error checked on the previous line
pkg/cmd/pulumi/preview.go:190:11: nilness: impossible condition: nil != nil (govet)
^- same error checked a few blocks above
pkg/codegen/pcl/binder_component.go:101:64: nilness: nil dereference in dynamic method call (govet)
^- err is guaranteed nil
pkg/codegen/pcl/binder_component.go:133:10: nilness: impossible condition: nil != nil (govet)
^- err is guaranteed nil
sdk/go/auto/errors_test.go:374:34: nilness: nil dereference in index operation (govet)
^- this is intentional; I replaced it with a deliberate panic
tests/integration/construct_component_methods_resources/testcomponent-go/random.go:30:10: nilness: impossible condition: non-nil == nil (govet)
^- args is rejected if it's nil