本文整理匯總了Golang中github.com/AntoineAugusti/moduluschecking/models.BankAccount.MergeAccountDetails方法的典型用法代碼示例。如果您正苦於以下問題:Golang BankAccount.MergeAccountDetails方法的具體用法?Golang BankAccount.MergeAccountDetails怎麽用?Golang BankAccount.MergeAccountDetails使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/AntoineAugusti/moduluschecking/models.BankAccount
的用法示例。
在下文中一共展示了BankAccount.MergeAccountDetails方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: DoubleAlternate
// Perform the double alternate algorithm and return
// the remainder of the operation
func DoubleAlternate(b m.BankAccount, data m.SortCodeData, sum int) (remainder int) {
numbers := b.MergeAccountDetails()
weights := data.Weights
for i, nb := range numbers {
sum += helpers.AddDigits(weights[i] * nb)
}
remainder = sum % 10
return
}
示例2: Modulus
// Perform the modulus algorithm with a given modulus
// and return the remainder of the operation
func Modulus(b m.BankAccount, modulus int, data m.SortCodeData) (remainder int) {
numbers := b.MergeAccountDetails()
sum := 0
weights := data.Weights
for i, nb := range numbers {
sum += weights[i] * nb
}
remainder = sum % modulus
return
}