func (table *ChessGame) StartClock(gameID int, minutes int, seconds int, name string) {
	timerChan := time.NewTicker(time.Second).C
	whiteClock := (minutes * 60) + seconds
	blackClock := (minutes * 60) + seconds
	startTime := whiteClock
	chessgame := All.Games[gameID]
	for {
		select {
		case <-table.gameOver:
			return
		case <-timerChan:
			if table.whiteTurn {
				whiteClock--
				remainingMinutes := whiteClock / 60
				remainingSeconds := whiteClock % 60
				chessgame.WhiteMinutes = remainingMinutes
				chessgame.WhiteSeconds = remainingSeconds
				if whiteClock <= 0 {
					chessgame.whiteTimeout(name)
					return
				}
			} else {
				blackClock--
				remainingMinutes := blackClock / 60
				remainingSeconds := blackClock % 60
				chessgame.BlackMinutes = remainingMinutes
				chessgame.BlackSeconds = remainingSeconds
				if blackClock <= 0 {
					chessgame.blackTimeout(name)
					return
				}
			}
		case <-table.resetBlackTime:
			blackClock = startTime
		case <-table.resetWhiteTime:
			whiteClock = startTime
		}
	}
}
keep track of both sides of the clock, when function exits the game is over
package gostuff
import (
	"encoding/json"
	"fmt"
	"time"
	"golang.org/x/net/websocket"
)