On Thu, Apr 21, 2022 at 9:27 AM Daniel Jankins <djank...@gmail.com> wrote:
>
> I have a serial port that is streaming data.  The data is terminated by a /r 
> only.
> I am trying to use scanner.Scan () to break up the lines.  Is there a way to 
> change the scanner end of line character to /r only?

See https://pkg.go.dev/bufio#Scanner.Split to change how the scanner
collects tokens.

Ian

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAOyqgcVB5Y9r%2BcZLvLXwvvn%2BpkR7NsSZQXNPmG1J6ys3Jf4phg%40mail.gmail.com.

Reply via email to