We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ffd6060 commit c30891cCopy full SHA for c30891c
filter/time.go
@@ -9,8 +9,8 @@ type Time time.Time
9
10
var timeFmt = "2006-01-02 15:04:05"
11
12
-func (t *Time) MarshalJSON() ([]byte, error) {
13
- fmtTime := time.Time(*t)
+func (t Time) MarshalJSON() ([]byte, error) {
+ fmtTime := time.Time(t)
14
formatted := fmt.Sprintf("\"%s\"", fmtTime.Format(timeFmt))
15
return []byte(formatted), nil
16
}
@@ -26,6 +26,6 @@ func (t *Time) UnmarshalJSON(data []byte) error {
26
return err
27
28
29
-func (t *Time) String() string {
30
- return time.Time(*t).Format(timeFmt)
+func (t Time) String() string {
+ return time.Time(t).Format(timeFmt)
31
0 commit comments