func (e Exception5Checker) IsValid(b m.BankAccount, sc m.SortCodeData, attempt int) bool {
	if !e.Handles(b, sc, attempt) {
		panic("Should be exception of type 5")
	}
	if substitution, hasKey := e.Substitutions[b.SortCode]; hasKey {
		b.SortCode = substitution
	}
	if attempt == 1 {
		checkDigit := b.NumberAtPosition("g")
		remainder := GeneralChecker{}.RemainderFromRegularCheck(b, sc)
		if remainder == 0 && checkDigit == 0 {
			return true
		}
		if remainder == 1 {
			return false
		}
		return (11 - remainder) == checkDigit
	}
	checkDigit := b.NumberAtPosition("h")
	remainder := GeneralChecker{}.RemainderFromRegularCheck(b, sc)
	if remainder == 0 && checkDigit == 0 {
		return true
	}
	return (10 - remainder) == checkDigit
}
Tell if the bank account is valid
package checkers
import (
	m "github.com/AntoineAugusti/moduluschecking/models"
)
type Exception5Checker struct {
	Substitutions map[string]string
}
func (e Exception5Checker) Handles(b m.BankAccount, sc m.SortCodeData, attempt int) bool {
	return sc.IsException(5)
}