Merge pull request #111372 from HeavenTonight/master

code cleanup
This commit is contained in:
Kubernetes Prow Robot
2023-03-10 11:44:40 -08:00
committed by GitHub
5 changed files with 11 additions and 11 deletions

View File

@@ -93,7 +93,7 @@ func TestAggregateWithNil(t *testing.T) {
}
func TestSingularAggregate(t *testing.T) {
var slice []error = []error{fmt.Errorf("err")}
var slice = []error{fmt.Errorf("err")}
var agg Aggregate
var err error
@@ -121,7 +121,7 @@ func TestSingularAggregate(t *testing.T) {
}
func TestPluralAggregate(t *testing.T) {
var slice []error = []error{fmt.Errorf("abc"), fmt.Errorf("123")}
var slice = []error{fmt.Errorf("abc"), fmt.Errorf("123")}
var agg Aggregate
var err error
@@ -149,7 +149,7 @@ func TestPluralAggregate(t *testing.T) {
}
func TestDedupeAggregate(t *testing.T) {
var slice []error = []error{fmt.Errorf("abc"), fmt.Errorf("abc")}
var slice = []error{fmt.Errorf("abc"), fmt.Errorf("abc")}
var agg Aggregate
agg = NewAggregate(slice)
@@ -165,7 +165,7 @@ func TestDedupeAggregate(t *testing.T) {
}
func TestDedupePluralAggregate(t *testing.T) {
var slice []error = []error{fmt.Errorf("abc"), fmt.Errorf("abc"), fmt.Errorf("123")}
var slice = []error{fmt.Errorf("abc"), fmt.Errorf("abc"), fmt.Errorf("123")}
var agg Aggregate
agg = NewAggregate(slice)
@@ -181,7 +181,7 @@ func TestDedupePluralAggregate(t *testing.T) {
}
func TestFlattenAndDedupeAggregate(t *testing.T) {
var slice []error = []error{fmt.Errorf("abc"), fmt.Errorf("abc"), NewAggregate([]error{fmt.Errorf("abc")})}
var slice = []error{fmt.Errorf("abc"), fmt.Errorf("abc"), NewAggregate([]error{fmt.Errorf("abc")})}
var agg Aggregate
agg = NewAggregate(slice)
@@ -197,7 +197,7 @@ func TestFlattenAndDedupeAggregate(t *testing.T) {
}
func TestFlattenAggregate(t *testing.T) {
var slice []error = []error{fmt.Errorf("abc"), fmt.Errorf("abc"), NewAggregate([]error{fmt.Errorf("abc"), fmt.Errorf("def"), NewAggregate([]error{fmt.Errorf("def"), fmt.Errorf("ghi")})})}
var slice = []error{fmt.Errorf("abc"), fmt.Errorf("abc"), NewAggregate([]error{fmt.Errorf("abc"), fmt.Errorf("def"), NewAggregate([]error{fmt.Errorf("def"), fmt.Errorf("ghi")})})}
var agg Aggregate
agg = NewAggregate(slice)

View File

@@ -39,7 +39,7 @@ func TestAddAnnotation(t *testing.T) {
assert.Equal(t, annotations["foo.admission.k8s.io/key1"], "value1", "admission annotations should not be overwritten")
// test invalid plugin names
var testCases map[string]string = map[string]string{
var testCases = map[string]string{
"invalid dns subdomain": "INVALID-DNS-Subdomain/policy",
"no plugin name": "policy",
"no key name": "foo.admission.k8s.io",