Enable unparam linter and fix issues

This commit is contained in:
Oleg Atamanenko
2018-06-14 19:52:30 -04:00
parent 9fc24634a2
commit f557841e54
18 changed files with 57 additions and 64 deletions

View File

@@ -234,10 +234,10 @@ func TestObjectConvertToUnstructured(t *testing.T) {
for _, tc := range testCases {
actual, err := objectToUnstructured(tc.input)
if err != nil {
t.Fatalf("unexpected error: %v", err)
t.Fatalf("%s: unexpected error: %v", tc.description, err)
}
if !reflect.DeepEqual(actual, tc.expected) {
t.Fatalf("%#v\ndoesn't match expected\n%#v\n", actual, tc.expected)
t.Fatalf("%s: %#v\ndoesn't match expected\n%#v\n", tc.description, actual, tc.expected)
}
}
}

View File

@@ -30,7 +30,7 @@ import (
)
// ParseRFC3339 parses an RFC3339 date in either RFC3339Nano or RFC3339 format.
func ParseRFC3339(s string, nowFn func() metav1.Time) (metav1.Time, error) {
func ParseRFC3339(s string) (metav1.Time, error) {
if t, timeErr := time.Parse(time.RFC3339Nano, s); timeErr == nil {
return metav1.Time{Time: t}, nil
}