Created
December 23, 2017 14:14
-
-
Save didasy/85319b02f202386c6ad46e01c066ff2a to your computer and use it in GitHub Desktop.
Read Line Helper Function for go-serial
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func readByLine(port io.ReadWriteCloser) { | |
scanner := bufio.NewScanner(port) | |
scanner.Split(bufio.ScanLines) | |
for scanner.Scan() { | |
// Will return string | |
fmt.Println(scanner.Text()) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment