Skip to content

Commit

Permalink
Add *[TYPE] to [TYPE]ptr methods
Browse files Browse the repository at this point in the history
  • Loading branch information
aq17 committed Dec 5, 2022
1 parent 20e5b33 commit 85fa445
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
@@ -0,0 +1,4 @@
changes:
- type: feat
scope: sdk
description: Add methods to cast pointer types to corresponding Pulumi Ptr types
5 changes: 5 additions & 0 deletions sdk/go/pulumi/generate/templates/types_builtins.go.template
Expand Up @@ -47,6 +47,11 @@ type {{.PtrType}} {{.ElemElementType}}
func {{.Name}}(v {{.ElemElementType}}) {{.Name}}Input {
return ({{.InputType}})(&v)
}
{{if .ImplementsPtrType}}
func {{.Name}}(v *{{.ElemElementType}}) {{.Name}}Input {
return ({{.InputType}})(v)
}
{{end}}
{{end}}
{{if .DefineInputMethods}}
// ElementType returns the element type of this Input ({{.ElementType}}).
Expand Down

0 comments on commit 85fa445

Please sign in to comment.