Just implement update logic in Methods where it is needed, since if there is no pointer I cannot hand it to any function or method

This commit is contained in:
2024-10-20 15:54:49 +02:00
parent 0b70a8ee10
commit 8fc6a10b0d
3 changed files with 138 additions and 32 deletions

View File

@@ -24,15 +24,6 @@ func NewDate(t time.Time) *Date {
}
}
// Update updates the Date.
func (d *Date) Update() {
if d == nil {
d = NewDate(time.Now())
} else {
d.DateTime = DateTime(time.Now())
}
}
// Check checks the Date for incompatibilities with RFC4287. It returns an
// error.
func (d *Date) Check() error {