Skip to content

Commit 0251474

Browse files
author
Matthew
committed
fix(tests): remove named error param
This value was being shadowed and hence not used. Explicitly returning the shadowed return value ensures this code performs as expected.
1 parent e4c2249 commit 0251474

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

time/time.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,23 +26,23 @@ func (t *Time) MarshalJSON() ([]byte, error) {
2626

2727
// UnmarshalText implements the encoding.TextUnmarshaler interface.
2828
// The time is expected to be in Deis' datetime format.
29-
func (t *Time) UnmarshalText(data []byte) (err error) {
29+
func (t *Time) UnmarshalText(data []byte) error {
3030
tt, err := time.Parse(DeisDatetimeFormat, string(data))
3131
if _, ok := err.(*time.ParseError); ok {
3232
tt, err = time.Parse(PyOpenSSLTimeDateTimeFormat, string(data))
3333
}
3434
*t = Time{tt}
35-
return
35+
return err
3636
}
3737

3838
// UnmarshalJSON implements the json.Unmarshaler interface.
3939
// The time is expected to be a quoted string in Deis' datetime format.
40-
func (t *Time) UnmarshalJSON(data []byte) (err error) {
40+
func (t *Time) UnmarshalJSON(data []byte) error {
4141
// Fractional seconds are handled implicitly by Parse.
4242
tt, err := time.Parse(`"`+DeisDatetimeFormat+`"`, string(data))
4343
if _, ok := err.(*time.ParseError); ok {
4444
tt, err = time.Parse(`"`+PyOpenSSLTimeDateTimeFormat+`"`, string(data))
4545
}
4646
*t = Time{tt}
47-
return
47+
return err
4848
}

0 commit comments

Comments
 (0)