github.com/hxx258456/ccgo@v0.0.5-0.20230213014102-48b35f46f66f/net/lif/sys.go (about) 1 // Copyright 2017 The Go Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 //go:build solaris 6 // +build solaris 7 8 package lif 9 10 import "unsafe" 11 12 var nativeEndian binaryByteOrder 13 14 func init() { 15 i := uint32(1) 16 b := (*[4]byte)(unsafe.Pointer(&i)) 17 if b[0] == 1 { 18 nativeEndian = littleEndian 19 } else { 20 nativeEndian = bigEndian 21 } 22 }