code: func (_ LongAlgebraicNotation) Decode(pos *Position, s string) (*Move, error) {
  	l := len(s)
  	err := fmt.Errorf(`chess: failed to decode long algebraic notation text "%s" for position %s`, s, pos.String())
  	if l < 4 || l > 5 {
  		return nil, err
  	}
  	s1, ok := strToSquareMap[s[0:2]]
  	if !ok {
  		return nil, err
  	}
  	s2, ok := strToSquareMap[s[2:4]]
  	if !ok {
  		return nil, err
  	}
  	promo := NoPieceType
  	if l == 5 {
  		promo = pieceTypeFromChar(s[4:5])
  		if promo == NoPieceType {
  			return nil, err
  		}
  	}
  	m := &Move{s1: s1, s2: s2, promo: promo}
  	p := pos.Board().Piece(s1)
  	if p.Type() == King {
  		if (s1 == E1 && s2 == G1) || (s1 == E8 && s2 == G8) {
  			m.addTag(KingSideCastle)
  		} else if (s1 == E1 && s2 == C1) || (s1 == E8 && s2 == C8) {
  			m.addTag(QueenSideCastle)
  		}
  	} else if p.Type() == Pawn && s2 == pos.enPassantSquare {
  		m.addTag(EnPassant)
  		m.addTag(Capture)
  	}
  	c1 := p.Color()
  	c2 := pos.Board().Piece(s2).Color()
  	if c2 != NoColor && c1 != c2 {
  		m.addTag(Capture)
  	}
  	return m, nil
  }
docs: // Decode implements the Decoder interface.