Good Morning from West Coast US! Recently asked ho...
# pulumi-ai
a
Good Morning from West Coast US! Recently asked how to read secrets using Golang and this was the answer returned:
Copy code
package main

import (
	"<http://github.com/pulumi/pulumi/sdk/v3/go/pulumi|github.com/pulumi/pulumi/sdk/v3/go/pulumi>"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		// Create a new instance of Pulumi Config.
		conf := pulumi.NewConfig(ctx)

		// Get a secret configuration value.
		// Replace "mySecret" with the key for your secret configuration item.
		mySecret := conf.RequireSecret("mySecret")

		// The `mySecret` variable now holds a reference to your secret
		// value and can be passed to resources that need it, while remaining encrypted.

		// To use the secret as part of a resource definition:
		// resourceArgs := &SomeResourceArgs{
		//     SecretProperty: mySecret,
		// }
		// myResource, err := NewSomeResource(ctx, "myResourceName", resourceArgs)
		// if err != nil {
		//     return err
		// }

		return nil
	})
}
This is incorrect and leads to: "pulumi.NewConfig(ctx) is undefined".