Skip to content

Instantly share code, notes, and snippets.

@didasy
Created December 23, 2017 14:14
Show Gist options
  • Save didasy/85319b02f202386c6ad46e01c066ff2a to your computer and use it in GitHub Desktop.
Save didasy/85319b02f202386c6ad46e01c066ff2a to your computer and use it in GitHub Desktop.
Read Line Helper Function for go-serial
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