pulumi / pulumi-std

Standard library functions implemented as a native Pulumi provider to be consumed from all Pulumi supported languages
Apache License 2.0
2 stars 2 forks source link

add importBasePath to schema to fix Go programgen #35

Closed dixler closed 6 months ago

dixler commented 6 months ago

Fixes #34 Fixes PR Lints failing

Pulumi convert programgen tries to infer the correct import path in Go. This inference is incorrect and has to be overridden in the schema.

I've tested that a locally built pulumi-resource-std picked up on PATH produces the desired go.mod.

% pulumi convert main.tf --from tf --language go
Converting from terraform...
Converting to go...
warning: using pulumi-resource-std from $PATH at /home/kdixler/go/bin/pulumi-resource-std
warning: using pulumi-resource-std from $PATH at /home/kdixler/go/bin/pulumi-resource-std
Installing dependencies...

go: finding module for package github.com/pulumi/pulumi-std/sdk/go/std
go: found github.com/pulumi/pulumi-std/sdk/go/std in github.com/pulumi/pulumi-std/sdk v1.4.0
Finished installing dependencies
% head go.mod
module foo

go 1.21

toolchain go1.21.3

require (
    github.com/pulumi/pulumi-aws/sdk/v6 v6.13.2
    github.com/pulumi/pulumi-std/sdk v1.4.0
    github.com/pulumi/pulumi/sdk/v3 v3.95.0
% head main.go
package main

import (
    "fmt"

    "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/s3"
    "github.com/pulumi/pulumi-std/sdk/go/std"
    "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {