github.com/myhau/pulumi/pkg/v3@v3.70.2-0.20221116134521-f2775972e587/codegen/testing/test/testdata/transpiled_examples/random-pp/go/random.go (about)

     1  package main
     2  
     3  import (
     4  	"fmt"
     5  
     6  	"github.com/pulumi/pulumi-random/sdk/v4/go/random"
     7  	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
     8  )
     9  
    10  func main() {
    11  	pulumi.Run(func(ctx *pulumi.Context) error {
    12  		randomPassword, err := random.NewRandomPassword(ctx, "randomPassword", &random.RandomPasswordArgs{
    13  			Length:          pulumi.Int(16),
    14  			Special:         pulumi.Bool(true),
    15  			OverrideSpecial: pulumi.String(fmt.Sprintf("_%v@", "%")),
    16  		})
    17  		if err != nil {
    18  			return err
    19  		}
    20  		ctx.Export("password", randomPassword.Result)
    21  		return nil
    22  	})
    23  }