-
Notifications
You must be signed in to change notification settings - Fork 9
fix issue with report dealing newlines, also turned lib to go module #23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Thanks! Would you mind adding a test case in |
spamc.go
Outdated
last := len(report.Table) - indexShift | ||
if last >= 0 { | ||
line = strings.TrimSpace(line) | ||
report.Table[last].Description += "\n " + line |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this would be clearer with strings.Repeat()
; for example (untested):
report.Table[last].Description += "\n " + line | |
report.Table[last].Description += "\n" + strings.Repeat(" ", 28) + strings.TrimSpace(line) |
spamc.go
Outdated
} else { | ||
indexShift := 1 | ||
|
||
last := len(report.Table) - indexShift |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since indexShift
is always 1
you can subtract it directly:
last := len(report.Table) - indexShift | |
last := len(report.Table) - 1 // Maybe comment why - 1? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, agreed with everything. Later on, i'll do test and any code modification as suggested. Thanks 👍
@ripexz Could you merge this please? Or give me access to this repo? |
Would be better to keep the move to go.mod in a separate PR but since it's here already - please update the build script as its running on pre-gomod go versions so it's failing. Also some lint errors in there it seems, but those might also be related to go version 🤔 |
fixed isue #19
also adding support for GO module