Skip to content

Commit

Permalink
removed named return
Browse files Browse the repository at this point in the history
  • Loading branch information
Seshachalam Malisetti committed Jul 16, 2015
1 parent e2a34fa commit d89542d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions timestamp.go
Expand Up @@ -18,15 +18,15 @@ func (t Timestamp) String() string {

// UnmarshalJSON implements the json.Unmarshaler interface.
// Time is expected in RFC3339 or Unix format.
func (t *Timestamp) UnmarshalJSON(data []byte) (err error) {
func (t *Timestamp) UnmarshalJSON(data []byte) error {
str := string(data)
i, err := strconv.ParseInt(str, 10, 64)
if err == nil {
t.Time = time.Unix(i, 0)
} else {
t.Time, err = time.Parse(`"`+time.RFC3339+`"`, str)
}
return
return err
}

// Equal reports whether t and u are equal based on time.Equal
Expand Down

0 comments on commit d89542d

Please sign in to comment.