func GoString(s StringRef) string {
	ptr := C.CFStringGetCStringPtr(unsafe.Pointer(s), C.kCFStringEncodingUTF8)

	if ptr != nil {
		return C.GoString(ptr)
	}

	n := C.CFStringGetLength(unsafe.Pointer(s))
	b := make([]byte, int(4*n))
	C.CFStringGetBytes(
		unsafe.Pointer(s),
		C.CFRange{0, n},
		C.kCFStringEncodingUTF8,
		'?',
		0,
		(*C.UInt8)(unsafe.Pointer(&b[0])),
		C.CFIndex(len(b)),
		&n,
	)

	return string(b[:n])
}
// GoString creates a new Go string value with a content equivalent to the
// StringRef object passed as argument.
GoString creates a new Go string value with a content equivalent to the
StringRef object passed as argument.
// GoString creates a new Go string value with a content equivalent to the // StringRef object passed as argument .
func GoString(s StringRef) string {
	ptr := C.CFStringGetCStringPtr(unsafe.Pointer(s), C.kCFStringEncodingUTF8)
	if ptr != nil {
		return C.GoString(ptr)
	}
	n := C.CFStringGetLength(unsafe.Pointer(s))
	b := make([]byte, int(4*n))
	C.CFStringGetBytes(
		unsafe.Pointer(s),
		C.CFRange{0, n},
		C.kCFStringEncodingUTF8,
		'?',
		0,
		(*C.UInt8)(unsafe.Pointer(&b[0])),
		C.CFIndex(len(b)),
		&n,
	)
	return string(b[:n])
}
func GoString ( s StringRef ) string { ptr := C . CFStringGetCStringPtr ( unsafe . Pointer ( s ) , C . kCFStringEncodingUTF8 ) if ptr != nil { return C . GoString ( ptr ) } n := C . CFStringGetLength ( unsafe . Pointer ( s ) ) b := make ( [ ] byte , int ( 4 * n ) ) C . CFStringGetBytes ( unsafe . Pointer ( s ) , C . CFRange { 0 , n } , C . kCFStringEncodingUTF8 , '?' , 0 , ( * C . UInt8 ) ( unsafe . Pointer ( & b [ 0 ] ) ) , C . CFIndex ( len ( b ) ) , & n , ) return string ( b [ : n ] ) }
GoString creates a new Go string value with a content equivalent to the
StringRef object passed as argument.
GoString creates a new Go string value with a content equivalent to the StringRef object passed as argument .