package quorum import ( "fmt" "time" ) type Score struct { ID string Value int time time.Time } func (s Score) Is(other Score) bool { return s.ID == other.ID && s.Value == other.Value } type Scores []Score func (s Scores) Winner() (Score, error) { if len(s) == 0 { return Score{}, fmt.Errorf("emtpy score, no winner") } return s[0], nil }