Skip to content

Commit

Permalink
fix lint errors (#328)
Browse files Browse the repository at this point in the history
  • Loading branch information
SparkYuan committed Apr 24, 2023
1 parent b5ebcb4 commit a16347d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 33 deletions.
28 changes: 0 additions & 28 deletions pkg/engine/runtime/terraform/tfops/workspace_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,34 +34,6 @@ var (
"resourceType": "local_file",
},
}
tfstateTest = StateRepresentation{
FormatVersion: "0.2",
TerraformVersion: "1.0.6",
Values: &stateValues{
RootModule: module{
Resources: []resource{
{
Address: "local_file.kusion_example",
Mode: "managed",
Type: "local_file",
Name: "kusion_example",
ProviderName: "registry.terraform.io/hashicorp/local",
SchemaVersion: 0,
AttributeValues: attributeValues{
"content": "kusion",
"directory_permission": "0777",
"file_permission": "0777",
"filename": "text.txt",
"sensitive_content": nil,
"source": nil,
"content_base64": nil,
},
},
},
},
},
}

fs = afero.Afero{Fs: afero.NewOsFs()}
)

Expand Down
16 changes: 11 additions & 5 deletions pkg/util/i18n/i18n_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,19 @@ func TestTranslationUsingEnvVar(t *testing.T) {

for _, test := range testCases {
t.Run(test.name, func(t *testing.T) {
for _, envVar := range envVarsToBackup {
if envVarValue := os.Getenv(envVar); envVarValue != "" {
os.Unsetenv(envVar)
// Restore env var at the end
defer func() { os.Setenv(envVar, envVarValue) }()
envBk := make(map[string]string)

for _, envKey := range envVarsToBackup {
if envValue := os.Getenv(envKey); envValue != "" {
os.Unsetenv(envKey)
envBk[envKey] = envValue
}
}
defer func(bk map[string]string) {
for k, v := range bk {
os.Setenv(k, v)
}
}(envBk)

test.setenvFn()

Expand Down

0 comments on commit a16347d

Please sign in to comment.