Skip to content

Commit e265cb2

Browse files
committed
[aostypes] Revert back changing marshal interface for time and duration
These changes causes wrong marshaling, suppress warning instead of changing interface. Signed-off-by: Oleksandr Grytsov <oleksandr_grytsov@epam.com>
1 parent 0b2d3fe commit e265cb2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

aostypes/aostypes.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,12 @@ const (
6666
**********************************************************************************************************************/
6767

6868
// Duration represents duration in format "00:00:00".
69-
type Duration struct {
69+
type Duration struct { //nolint:recvcheck
7070
time.Duration
7171
}
7272

7373
// Time represents time in format "00:00:00".
74-
type Time struct {
74+
type Time struct { //nolint:recvcheck
7575
time.Time
7676
}
7777

@@ -262,7 +262,7 @@ type NodeMonitoring struct {
262262
**********************************************************************************************************************/
263263

264264
// MarshalJSON marshals JSON Time type.
265-
func (t *Time) MarshalJSON() (b []byte, err error) {
265+
func (t Time) MarshalJSON() (b []byte, err error) {
266266
if b, err = json.Marshal(t.Format("15:04:05")); err != nil {
267267
return nil, aoserrors.Wrap(err)
268268
}
@@ -319,7 +319,7 @@ func (t *Time) UnmarshalJSON(b []byte) (err error) {
319319
}
320320

321321
// MarshalJSON marshals JSON Duration type.
322-
func (d *Duration) MarshalJSON() (b []byte, err error) {
322+
func (d Duration) MarshalJSON() (b []byte, err error) {
323323
if b, err = json.Marshal(d.Duration.String()); err != nil {
324324
return nil, aoserrors.Wrap(err)
325325
}

0 commit comments

Comments
 (0)