4 ms·
* []byte and string aren't the same. ...and how could they be?
by kleiba 14y ago
* []byte and string aren't the same.
...and how could they be?
- arnsholt 14y agoDespite Unicode being something like 20 years old, people still expect strings to be byte arrays and other assorted lunacy, like reading from file not requiring stuff like encodings. "How hard can it be" to just figure out which encoding the file has, after all...
- EdiX 14y agoBTW in go a string can be cast to []byte like this: []byte(aString) it returns the utf-8 bytes, casting to []rune gives unicode codepoints.