package chess type Violation string var ( InvalidMove Violation = "invalid move" NoPieceAtStartSquare Violation = "no piece at start square" WrongColorMoved Violation = "wrong color moved" TargetSquareIsOccupied Violation = "target square is occupied" KingInCheck Violation = "king would be in check after move" SomethingWentWrong Violation = "something went wrong" ) func (v Violation) String() string { return string(v) }