If you want to cast an array of bytes to a struct, the unsafe package can do it for you. Here is a working example:

There are limitations to the struct field types you can use in this way. Slices and strings are out, unless your C code yields exactly the right memory layout for the respective slice/string headers, which is unlikely. If it's just fixed size arrays and types like (u)int(8/16/32/64), the code below may be good enough. Otherwise you'll have to manually copy and assign each struct field by hand.

package main

import "fmt"
import "unsafe"

type T struct {
    A uint32
    B int16
}

var sizeOfT = unsafe.Sizeof(T{})

func main() {
    t1 := T{123, -321}
    fmt.Printf("%#v\n", t1)

    data := (*(*[1<<31 - 1]byte)(unsafe.Pointer(&t1)))[:sizeOfT]
    fmt.Printf("%#v\n", data)

    t2 := (*(*T)(unsafe.Pointer(&data[0])))
    fmt.Printf("%#v\n", t2)
}
(*[1<<31 - 1]byte)...[:sizeOfT]1<<31 - 1