In Go, I want to read in a file line by line, into str
's or []rune
's.
The file should be encoded in UTF-8, but my program shouldn't trust it. If it contains invalid UTF-8, I want to properly handle the error.
There is bytes.Runes(s []byte) []rune
, but that has no error return value. Will it panic on encountering invalid UTF-8?