我怀疑你是在追逐这样的游乐场
调整
LittleEndian为
BigEndian适当的
package mainimport ( "bytes" "encoding/binary" "fmt")func main() { buf := new(bytes.Buffer) source := []uint32{1, 2, 3} err := binary.Write(buf, binary.LittleEndian, source) if err != nil { fmt.Println("binary.Write failed:", err) } fmt.Printf("Enpred: % xn", buf.Bytes()) check := make([]uint32, 3) rbuf := bytes.NewReader(buf.Bytes()) err = binary.Read(rbuf, binary.LittleEndian, &check) if err != nil { fmt.Println("binary.Read failed:", err) } fmt.Printf("Depred: %vn", check)}

![在golang中将[] uint32转换为[] byte,反之亦然 在golang中将[] uint32转换为[] byte,反之亦然](http://www.mshxw.com/aiimages/31/436306.png)
