--- a/instance.go Thu Sep 06 01:07:40 2018 +0200
+++ b/instance.go Thu Sep 06 11:28:42 2018 +0200
@@ -7,11 +7,6 @@
package madon
import (
- "fmt"
- "strconv"
- "strings"
- "time"
-
"github.com/sendgrid/rest"
)
@@ -45,24 +40,3 @@
}
return activity, nil
}
-
-/* Activity time handling */
-
-// UnmarshalJSON handles deserialization for custom ActivityTime type
-func (act *ActivityTime) UnmarshalJSON(b []byte) error {
- s, err := strconv.ParseInt(strings.Trim(string(b), "\""), 10, 64)
- if err != nil {
- return err
- }
- if s == 0 {
- act.Time = time.Time{}
- return nil
- }
- act.Time = time.Unix(s, 0)
- return nil
-}
-
-// MarshalJSON handles serialization for custom ActivityTime type
-func (act *ActivityTime) MarshalJSON() ([]byte, error) {
- return []byte(fmt.Sprintf("\"%d\"", act.Unix())), nil
-}