The hack would be to use unsafe after converting it to a byte slice to cast to a Pointer and cast that back to a uint32 slice. This is bad. Do not do this.
Go's ethos is pretty strongly against 'super cool hacks' or 'code golf' style statements that perform magic to stuff a lot of code into one instruction. Indeed, Go is pretty much the opposite - plain code that does what it appears to do with minimal magic, for maximum long-term and large-group maintainability of the codebase. This StackOverflow answer provides an example of the unsafe way: https://stackoverflow.com/questions/11924196/convert-between-slices-of-different-types As it also says, this is strongly not recommended. -- 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+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.