--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/golang-nuts/5bb6ca8a-9a69-4262-a2f5-c6fb109a40a4n%40googlegroups.com.
Alternatively, if this kind of slice type conversion is truly disallowed, can anyone suggest a better way of writing the above function that maintains its readability and performance?
Happy to help. If you’re coming from C, Go’s "type Symbol = byte" is directly equivalent to C’s "typedef unsigned char Symbol". It does not create a new type; it’s purely a type alias.
By contrast, "type Symbol byte" defines a new and distinct type.