package board // Card represents a card on a Kanban board. type Card struct { ID int Title string Description string Created string } // SetID updates the ID of the Card value only if // the ID is < 1 (i.e. unset). func (c *Card) SetID(id int) error { if id < 1 { return InvalidIDError{id} } if c.ID > 0 { return IDAlreadySetError{} } c.ID = id return nil } // GetID returns the ID of the Card value. func (c *Card) GetID() int { return c.ID }