TinyGo drivers for sensors, displays, wireless adaptors, and other devices that use I2C, SPI, GPIO, ADC, and UART interfaces.
BSD 3-Clause "New" or "Revised" License
604
stars
188
forks
source link
Cannot use bufio.Scanner for conn #431
Open
sago35 opened 2 years ago
For now, conn.Read may return a length of 0, so
bufio.NewScanner()
cannot be used. Similarly,fmt.Fscanf()
cannot be used.Similar to the following https://github.com/tinygo-org/tinygo/pull/2739
What works now is the following code.
I would like the following to work also Because I think that is Go-way code. Of course, we can check for errors by using conn.Read.