From 223267ac8585f3a403e96f04706d2fa9bc5ceae9 Mon Sep 17 00:00:00 2001 From: Florian Kinder Date: Mon, 1 Jul 2024 14:32:37 +0900 Subject: [PATCH] Fixed syntax --- pkg/infra/models/jira_time.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pkg/infra/models/jira_time.go b/pkg/infra/models/jira_time.go index b8030556..b514a740 100644 --- a/pkg/infra/models/jira_time.go +++ b/pkg/infra/models/jira_time.go @@ -10,11 +10,11 @@ const ( // DateScheme is a custom time type for Jira dates. type DateScheme time.Time -func (d DateScheme) MarshalJSON() ([]byte, error) { - return []byte(time.Time(d).Format(DateFormat)), nil +func (d *DateScheme) MarshalJSON() ([]byte, error) { + return []byte(time.Time(*d).Format(DateFormat)), nil } -func (d DateScheme) UnmarshalJSON(data []byte) error { +func (d *DateScheme) UnmarshalJSON(data []byte) error { if string(data) == "null" { return nil } @@ -24,18 +24,18 @@ func (d DateScheme) UnmarshalJSON(data []byte) error { return err } - d = DateScheme(parsed) + *d = DateScheme(parsed) return nil } // DateTimeScheme is a custom time type for Jira times. type DateTimeScheme time.Time -func (d DateTimeScheme) MarshalJSON() ([]byte, error) { - return []byte(time.Time(d).Format(TimeFormat)), nil +func (d *DateTimeScheme) MarshalJSON() ([]byte, error) { + return []byte(time.Time(*d).Format(TimeFormat)), nil } -func (d DateTimeScheme) UnmarshalJSON(data []byte) error { +func (d *DateTimeScheme) UnmarshalJSON(data []byte) error { if string(data) == "null" { return nil } @@ -45,6 +45,6 @@ func (d DateTimeScheme) UnmarshalJSON(data []byte) error { return err } - d = DateTimeScheme(parsed) + *d = DateTimeScheme(parsed) return nil }