File: newtime.go

package info (click to toggle)
golang-github-tinylib-msgp 1.2.5-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 836 kB
  • sloc: makefile: 47
file content (36 lines) | stat: -rw-r--r-- 536 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package _generated

import "time"

//go:generate msgp -v

//msgp:newtime

type NewTime struct {
	T     time.Time
	Array []time.Time
	Map   map[string]time.Time
}

func (t1 NewTime) Equal(t2 NewTime) bool {
	if !t1.T.Equal(t2.T) {
		return false
	}
	if len(t1.Array) != len(t2.Array) {
		return false
	}
	for i := range t1.Array {
		if !t1.Array[i].Equal(t2.Array[i]) {
			return false
		}
	}
	if len(t1.Map) != len(t2.Map) {
		return false
	}
	for k, v := range t1.Map {
		if !t2.Map[k].Equal(v) {
			return false
		}
	}
	return true
}