Skip to content

Added a helper function to handle writing strings with conditional checks. - #3

Open
Montana wants to merge 1 commit into
dundee:masterfrom
Montana:patch-1
Open

Added a helper function to handle writing strings with conditional checks. #3
Montana wants to merge 1 commit into
dundee:masterfrom
Montana:patch-1

Conversation

@Montana

@Montana Montana commented Aug 5, 2024

Copy link
Copy Markdown

Added a helper function to handle writing strings with conditional checks.

…ecks.

Added a helper function to handle writing strings with conditional checks.
Comment thread epc/epc.go
res.WriteString(base.TrimToLength(p.Msg, 70))
}
writeIfNotEmpty(p.Purpose, 4)
writeIfNotEmpty(p.Reference, 140)

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think one newline is missing here.

Comment thread epc/epc.go
Comment on lines 45 to -40
if p.BIC != "" {
res.WriteString(base.TrimToLength(p.BIC, 11))
sb.WriteString(base.TrimToLength(p.BIC, 11) + "\n")
} else {
sb.WriteString("\n")
}
res.WriteString("\n")

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not to use writeIfNotEmpty here as well?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants