func (addenda10 *Addenda10) Validate() error {
	if err := addenda10.fieldInclusion(); err != nil {
		return err
	}
	if addenda10.recordType != "7" {
		return fieldError("recordType", NewErrRecordType(7), addenda10.recordType)
	}
	if err := addenda10.isTypeCode(addenda10.TypeCode); err != nil {
		return fieldError("TypeCode", err, addenda10.TypeCode)
	}
	if addenda10.TypeCode != "10" {
		return fieldError("TypeCode", ErrAddendaTypeCode, addenda10.TypeCode)
	}
	if err := addenda10.isTransactionTypeCode(addenda10.TransactionTypeCode); err != nil {
		return fieldError("TransactionTypeCode", err, addenda10.TransactionTypeCode)
	}
	if err := addenda10.isAlphanumeric(addenda10.ForeignTraceNumber); err != nil {
		return fieldError("ForeignTraceNumber", err, addenda10.ForeignTraceNumber)
	}
	if err := addenda10.isAlphanumeric(addenda10.Name); err != nil {
		return fieldError("Name", err, addenda10.Name)
	}
	return nil
}
Validate performs NACHA format rule checks on the record and returns an error if not Validated
The first error encountered is returned and stops that parsing.
package ach
import (
	"strings"
	"unicode/utf8"
)
type Addenda10 struct {
	ID string `json:"id"`
	recordType string
	TypeCode string `json:"typeCode"`
	TransactionTypeCode string `json:"transactionTypeCode"`
	ForeignPaymentAmount int `json:"foreignPaymentAmount"`
	ForeignTraceNumber string `json:"foreignTraceNumber,omitempty"`
	Name string `json:"name"`
	reserved string
	EntryDetailSequenceNumber int `json:"entryDetailSequenceNumber"`
	validator
	converters
}
func NewAddenda10() *Addenda10 {
	addenda10 := new(Addenda10)
	addenda10.recordType = "7"
	addenda10.TypeCode = "10"
	return addenda10
}
func (addenda10 *Addenda10) Parse(record string) {
	if utf8.RuneCountInString(record) != 94 {
		return
	}
	addenda10.recordType = "7"
	addenda10.TypeCode = record[1:3]
	addenda10.TransactionTypeCode = record[3:6]
	addenda10.ForeignPaymentAmount = addenda10.parseNumField(record[06:24])
	addenda10.ForeignTraceNumber = strings.TrimSpace(record[24:46])
	addenda10.Name = strings.TrimSpace(record[46:81])
	addenda10.reserved = "      "
	addenda10.EntryDetailSequenceNumber = addenda10.parseNumField(record[87:94])
}
func (addenda10 *Addenda10) String() string {
	var buf strings.Builder
	buf.Grow(94)
	buf.WriteString(addenda10.recordType)
	buf.WriteString(addenda10.TypeCode)
	buf.WriteString(addenda10.TransactionTypeCode)
	buf.WriteString(addenda10.ForeignPaymentAmountField())
	buf.WriteString(addenda10.ForeignTraceNumberField())
	buf.WriteString(addenda10.NameField())
	buf.WriteString(addenda10.reservedField())
	buf.WriteString(addenda10.EntryDetailSequenceNumberField())
	return buf.String()
}