github.com/jingleWang/moby@v1.13.1/pkg/platform/utsname_int8.go (about)

     1  // +build linux,386 linux,amd64 linux,arm64
     2  // see golang's sources src/syscall/ztypes_linux_*.go that use int8
     3  
     4  package platform
     5  
     6  // Convert the OS/ARCH-specific utsname.Machine to string
     7  // given as an array of signed int8
     8  func charsToString(ca [65]int8) string {
     9  	s := make([]byte, len(ca))
    10  	var lens int
    11  	for ; lens < len(ca); lens++ {
    12  		if ca[lens] == 0 {
    13  			break
    14  		}
    15  		s[lens] = uint8(ca[lens])
    16  	}
    17  	return string(s[0:lens])
    18  }