code: func decodeFEN(fen string) (*Position, error) {
  	fen = strings.TrimSpace(fen)
  	parts := strings.Split(fen, " ")
  	if len(parts) != 6 {
  		return nil, fmt.Errorf("chess: fen invalid notiation %s must have 6 sections", fen)
  	}
  	b, err := fenBoard(parts[0])
  	if err != nil {
  		return nil, err
  	}
  	turn, ok := fenTurnMap[parts[1]]
  	if !ok {
  		return nil, fmt.Errorf("chess: fen invalid turn %s", parts[1])
  	}
  	rights, err := formCastleRights(parts[2])
  	if err != nil {
  		return nil, err
  	}
  	sq, err := formEnPassant(parts[3])
  	if err != nil {
  		return nil, err
  	}
  	halfMoveClock, err := strconv.Atoi(parts[4])
  	if err != nil || halfMoveClock < 0 {
  		return nil, fmt.Errorf("chess: fen invalid half move clock %s", parts[4])
  	}
  	moveCount, err := strconv.Atoi(parts[5])
  	if err != nil || moveCount < 1 {
  		return nil, fmt.Errorf("chess: fen invalid move count %s", parts[5])
  	}
  	return &Position{
  		board:           b,
  		turn:            turn,
  		castleRights:    rights,
  		enPassantSquare: sq,
  		halfMoveClock:   halfMoveClock,
  		moveCount:       moveCount,
  	}, nil
  }
docs: // Decodes FEN notation into a GameState.  An error is returned
  // if there is a parsing error.  FEN notation format:
  // rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1