github.com/gramework/runtimer@v0.0.0-20211014201118-d25b6e2ccefd/utils.go (about)

     1  package runtimer
     2  
     3  import (
     4  	"unsafe" // #nosec
     5  )
     6  
     7  func PtrToString(ptr unsafe.Pointer) string {
     8  	return *(*string)(ptr)
     9  }
    10  
    11  func PtrToStringPtr(ptr unsafe.Pointer) *string {
    12  	return (*string)(ptr)
    13  }
    14  
    15  func PtrPtrToStringPtr(ptr *unsafe.Pointer) *string {
    16  	return (*string)(*ptr)
    17  }