github.com/insolar/vanilla@v0.0.0-20201023172447-248fdf805322/unsafekit/memarch_be.go (about)

     1  // Copyright 2020 Insolar Network Ltd.
     2  // All rights reserved.
     3  // This material is licensed under the Insolar License version 1.0,
     4  // available at https://github.com/insolar/assured-ledger/blob/master/LICENSE.md.
     5  
     6  // +build mips mips64 ppc64 s390x
     7  
     8  package unsafekit
     9  
    10  import "unsafe"
    11  
    12  const BigEndian = true
    13  
    14  func init() {
    15  	bytes := [4]byte{1, 2, 3, 4}
    16  	v := *((*uint32)((unsafe.Pointer)(&bytes)))
    17  	if v != 0x01020304 {
    18  		panic("FATAL - expected BigEndian memory architecture")
    19  	}
    20  }