-
-
Notifications
You must be signed in to change notification settings - Fork 383
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
like golang: golang/go@2580d0e
- Loading branch information
Showing
35 changed files
with
106 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,21 +22,21 @@ import ( | |
) | ||
|
||
func TestParamsToEnv(t *testing.T) { | ||
from := map[string]interface{}{ | ||
from := map[string]any{ | ||
"skip": nil, | ||
"string": "stringz", | ||
"int": 1, | ||
"float": 1.2, | ||
"bool": true, | ||
"slice": []int{1, 2, 3}, | ||
"map": map[string]interface{}{"hello": "world"}, | ||
"map": map[string]any{"hello": "world"}, | ||
"complex": []struct{ Name string }{{"Jack"}, {"Jill"}}, | ||
"complex2": struct{ Name string }{"Jack"}, | ||
"from.address": "[email protected]", | ||
"tags": stringsToInterface("next", "latest"), | ||
"tag": stringsToInterface("next"), | ||
"my_secret": map[string]interface{}{"from_secret": "secret_token"}, | ||
"UPPERCASE_SECRET": map[string]interface{}{"from_secret": "SECRET_TOKEN"}, | ||
"my_secret": map[string]any{"from_secret": "secret_token"}, | ||
"UPPERCASE_SECRET": map[string]any{"from_secret": "SECRET_TOKEN"}, | ||
} | ||
want := map[string]string{ | ||
"PLUGIN_STRING": "stringz", | ||
|
@@ -62,7 +62,7 @@ func TestParamsToEnv(t *testing.T) { | |
|
||
// handle edge cases (#1609) | ||
got = map[string]string{} | ||
assert.NoError(t, ParamsToEnv(map[string]interface{}{"a": []interface{}{"a", nil}}, got, nil)) | ||
assert.NoError(t, ParamsToEnv(map[string]any{"a": []any{"a", nil}}, got, nil)) | ||
assert.EqualValues(t, map[string]string{"PLUGIN_A": "a,"}, got) | ||
} | ||
|
||
|
@@ -95,7 +95,7 @@ list.map: | |
password: | ||
from_secret: cb_password | ||
`) | ||
var from map[string]interface{} | ||
var from map[string]any | ||
err := yaml.Unmarshal(fromYAML, &from) | ||
assert.NoError(t, err) | ||
|
||
|
@@ -122,7 +122,7 @@ func TestYAMLToParamsToEnvError(t *testing.T) { | |
fromYAML := []byte(`my_secret: | ||
from_secret: not_a_secret | ||
`) | ||
var from map[string]interface{} | ||
var from map[string]any | ||
err := yaml.Unmarshal(fromYAML, &from) | ||
assert.NoError(t, err) | ||
secrets := map[string]string{ | ||
|
@@ -131,8 +131,8 @@ func TestYAMLToParamsToEnvError(t *testing.T) { | |
assert.Error(t, ParamsToEnv(from, make(map[string]string), secrets)) | ||
} | ||
|
||
func stringsToInterface(val ...string) []interface{} { | ||
res := make([]interface{}, len(val)) | ||
func stringsToInterface(val ...string) []any { | ||
res := make([]any, len(val)) | ||
for i := range val { | ||
res[i] = val[i] | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.