slackcat
slackcat copied to clipboard
Printing actual http error, closing response body
Before:
2014/05/21 18:33:21 Post failed: Not OK
After:
2014/05/21 18:37:00 Post failed: Not OK: 500, No text specified
Also, response body should be closed since it is io.ReadCloser
.
Probably you should update readme too, following files with empty lines will cause http error 500:
tail -F logfile | slackcat
will trigger error above, when:
tail -F logfile | grep --line-buffered -v '^\s*$' | slackcat
will work just fine.
I too had to work out the --line-buffered
option.