Skip to content

Commit

Permalink
meta: gofmt source files
Browse files Browse the repository at this point in the history
  • Loading branch information
adamdecaf committed Mar 22, 2023
1 parent cf6c378 commit a8f0c38
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions originatorToBeneficiary.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func (ob *OriginatorToBeneficiary) Parse(record string) error {
length += read

if len(ob.LineOne) >= 35 {
length += (strings.Index(record[length:], "*") +1)
length += (strings.Index(record[length:], "*") + 1)
}
value, read, err = ob.parseVariableStringField(record[length:], 35)
if err != nil {
Expand All @@ -66,8 +66,8 @@ func (ob *OriginatorToBeneficiary) Parse(record string) error {
ob.LineTwo = value
length += read

if len(ob.LineTwo) >= 35 {
length += (strings.Index(record[length:], "*") +1)
if len(ob.LineTwo) >= 35 {
length += (strings.Index(record[length:], "*") + 1)
}
value, read, err = ob.parseVariableStringField(record[length:], 35)
if err != nil {
Expand All @@ -76,8 +76,8 @@ func (ob *OriginatorToBeneficiary) Parse(record string) error {
ob.LineThree = value
length += read

if len(ob.LineThree) >= 35 {
length += (strings.Index(record[length:], "*") +1)
if len(ob.LineThree) >= 35 {
length += (strings.Index(record[length:], "*") + 1)
}
value, read, err = ob.parseVariableStringField(record[length:], 35)
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions originatorToBeneficiary_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ func TestStringOriginatorToBeneficiaryOptions(t *testing.T) {
require.Equal(t, record.String(), record.Format(FormatOptions{VariableLengthFields: false}))
}

// TestStringOriginatorToBeneficiaryOptionsWithExtraLength validates the length of each line if it exceeds the limit of 35 chars per line
// TestStringOriginatorToBeneficiaryOptionsWithExtraLength validates the length of each line if it exceeds the limit of 35 chars per line
func TestStringOriginatorToBeneficiaryOptionsWithExtraLength(t *testing.T) {
var line = "{6000}Lorem ipsum dolor sit amet, co WOODEN*adipiscing elit, sed do eiusmod 54F*022/FROM MYCOMPY INC. VIA MYBANKNIF*SUC INTERNAL BANK TO BANK TRANSFER,*"
r := NewReader(strings.NewReader(line))
Expand Down Expand Up @@ -172,4 +172,4 @@ func TestStringOriginatorToBeneficiaryOptionsWithSmallerLength(t *testing.T) {
require.Equal(t, r.currentFEDWireMessage.OriginatorToBeneficiary.LineTwo, "adipiscing elit, sed do eiusmod 54F")
require.Equal(t, r.currentFEDWireMessage.OriginatorToBeneficiary.LineThree, "022/FROM INC. VIA MYBANKNIF")
require.Equal(t, r.currentFEDWireMessage.OriginatorToBeneficiary.LineFour, "SUC INTERNAL BANK TO TRANSFER,")
}
}

0 comments on commit a8f0c38

Please sign in to comment.