For conversations with long histories, bufio.Scanner is not able to parse the entire output in one scan. As per the Go docs' reccomendation:
Programs that need more control over error handling or large tokens, or must run sequential scans on a reader, should use bufio.Reader instead.
I opted to use bufio.Reader instead.
This change only affects functions like GetTextMessages and sends; the listen functionality still uses scanners because bufio.Scanner seems perfectly capable of handling message output from a listen. This could change in the future and may be worth revisiting, but I figured I wouldn't change what isn't broken.
For conversations with long histories,
bufio.Scanner
is not able to parse the entire output in one scan. As per the Go docs' reccomendation:I opted to use
bufio.Reader
instead.This change only affects functions like
GetTextMessages
and sends; the listen functionality still uses scanners becausebufio.Scanner
seems perfectly capable of handling message output from a listen. This could change in the future and may be worth revisiting, but I figured I wouldn't change what isn't broken.