package cv import ( "fmt" "time" ) type CV struct { FirstName string `json:"firstName"` LastName string `json:"lastName"` JobTitle string `json:"jobTitle"` Contact map[string]string `json:"contact"` Links map[string]string `json:"links"` Summary []string `json:"summary"` Skills []Skills `json:"skills"` Employment []Experience `json:"employment"` Education []Experience `json:"education"` Interests []string `json:"interests"` } type Skills struct { Category string `json:"category"` Values []string `json:"values"` } type Experience struct { Company string `json:"company"` School string `json:"school"` Location string `json:"location"` LocationType string `json:"locationType"` JobTitle string `json:"jobTitle"` Qualification string `json:"qualification"` Duration Duration `json:"duration"` Details []string `json:"details"` } type Duration struct { Start Date `json:"start"` End Date `json:"end"` Present bool `json:"present"` } func (d Duration) After(t time.Time) (bool, error) { endDate, err := d.End.ParseDate() if err != nil { return false, err } return endDate.After(t), nil } type Date struct { Year int `json:"year"` Month int `json:"month"` Day int `json:"day"` } func (d Date) ParseDate() (time.Time, error) { dateStr := fmt.Sprintf("%d-%02d-%02d", d.Year, d.Month, d.Day) date, err := time.Parse(time.DateOnly, dateStr) if err != nil { return time.Time{}, fmt.Errorf("unable to parse the date; %w", err) } return date, nil }