It is possible to use a slice and check that the value casts to the right length by using a marshaling structure.