hello all. I’m having trouble getting exports to w...
# golang
i
hello all. I’m having trouble getting exports to work. I removed all my resource to the simplest example I could try and it isn’t working. Can someone explain why this code sample is broken please?
Copy code
package main

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

func main() {

	pulumi.Run(func(ctx *pulumi.Context) error {
		ctx.Export("x", "hello")
		return nil

	})
}
b
Apologies for the delay in response.
I just gave this a whirl and it seems to work as expected on the latest version:
Copy code
$ pulumi up
Previewing update (go-hw-dev):

     Type                 Name             Plan
 +   pulumi:pulumi:Stack  go-hw-go-hw-dev  create

Resources:
    + 1 to create

Do you want to perform this update? yes
Updating (go-hw-dev):

     Type                 Name             Status
 +   pulumi:pulumi:Stack  go-hw-go-hw-dev  created

Outputs:
    x: "hello"

Resources:
    + 1 created

Duration: 1s

Permalink: <https://app.pulumi.com/joeduffy/go-hw-dev/updates/1>
$ pulumi stack output
Current stack outputs (1):
    OUTPUT  VALUE
    x       hello
Can you double check that you re-built the binary, and if it still occurs, let me know what version you're using? (
pulumi version
)
i
I cleared out my dependencies and reloaded them and now it works. I’m not entirely sure which version I was running previously
👍 1