Skip to content

Commit 04ddb23

Browse files
paultyngpaddycarver
authored andcommitted
Allow for "v" prefix in version strings
I've accidentally made this error a few times, since Go uses these in its .mod file, etc. May be a bit more forgiving for users.
1 parent 695f0c7 commit 04ddb23

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

internal/plugintest/config.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"fmt"
66
"io/ioutil"
77
"os"
8+
"strings"
89

910
"github.com/hashicorp/terraform-exec/tfinstall"
1011
)
@@ -23,7 +24,7 @@ type Config struct {
2324
// DiscoverConfig uses environment variables and other means to automatically
2425
// discover a reasonable test helper configuration.
2526
func DiscoverConfig(sourceDir string) (*Config, error) {
26-
tfVersion := os.Getenv("TF_ACC_TERRAFORM_VERSION")
27+
tfVersion := strings.TrimPrefix(os.Getenv("TF_ACC_TERRAFORM_VERSION"), "v")
2728
tfPath := os.Getenv("TF_ACC_TERRAFORM_PATH")
2829

2930
tempDir := os.Getenv("TF_ACC_TEMP_DIR")

0 commit comments

Comments
 (0)