package models import ( "errors" ) type TestingStrategy int32 const ( EachTestTS TestingStrategy = 1 CompleteGroupTS TestingStrategy = 2 ) type Testgroup struct { Id *int32 `db:"id"` ProblemId *int32 `db:"problem_id"` TestingStrategy *TestingStrategy `db:"testing_strategy"` } type TestGroupData struct { Ts TestingStrategy TestAmount int32 } var ErrBadTestingStrategy = errors.New("bad testing strategy") func (ts TestingStrategy) Valid() error { switch ts { case EachTestTS, CompleteGroupTS: return nil } return ErrBadTestingStrategy }