gitlab.com/evatix-go/core@v1.3.55/converters/UnsafeBytesToString.go (about)

     1  package converters
     2  
     3  import (
     4  	"unsafe"
     5  
     6  	"gitlab.com/evatix-go/core/constants"
     7  )
     8  
     9  func UnsafeBytesToString(unsafeBytes []byte) string {
    10  	if unsafeBytes == nil {
    11  		return constants.EmptyString
    12  	}
    13  
    14  	return *(*string)(unsafe.Pointer(&unsafeBytes))
    15  }