File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ func (t *Time) MarshalJSON() ([]byte, error) {
2727// The time is expected to be in Deis' datetime format.
2828func (t * Time ) UnmarshalText (data []byte ) (err error ) {
2929 tt , err := time .Parse (DeisDatetimeFormat , string (data ))
30- if err != nil {
30+ if _ , ok := err .( * time. ParseError ); ok {
3131 tt , err = time .Parse (PyOpenSSLTimeDateTimeFormat , string (data ))
3232 }
3333 * t = Time {tt }
@@ -39,7 +39,7 @@ func (t *Time) UnmarshalText(data []byte) (err error) {
3939func (t * Time ) UnmarshalJSON (data []byte ) (err error ) {
4040 // Fractional seconds are handled implicitly by Parse.
4141 tt , err := time .Parse (`"` + DeisDatetimeFormat + `"` , string (data ))
42- if err != nil {
42+ if _ , ok := err .( * time. ParseError ); ok {
4343 tt , err = time .Parse (`"` + PyOpenSSLTimeDateTimeFormat + `"` , string (data ))
4444 }
4545 * t = Time {tt }
You can’t perform that action at this time.
0 commit comments