Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[codegen/go] Fix Go resource registrations #6641

Merged
merged 1 commit into from
Mar 31, 2021
Merged

Commits on Mar 29, 2021

  1. [codegen/go] Fix Go resource registrations

    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.
    justinvp committed Mar 29, 2021
    Configuration menu
    Copy the full SHA
    a40d1ef View commit details
    Browse the repository at this point in the history