I get a byte slice ([]byte) from a UDP socket and want to treat it as an integer slice ([]int32) without changing the underlying array, and vice ve
[]byte
[]int32
http://play.golang.org/p/w1m5Cs-ecz
package main import ( "fmt" "strings" ) func main() { s := []interface{}{"foo", "bar", "baz"} b := make([]string, len(s)) for i, v := range s { b[i] = v.(string) } fmt.Println(strings.Join(b, ", ")) }