mirror of
https://github.com/chai2010/advanced-go-programming-book.git
synced 2025-05-23 20:02:22 +00:00
30 lines
654 B
Plaintext
30 lines
654 B
Plaintext
' Copyright 2017 <chaishushan{AT}gmail.com>. All rights reserved.
|
|
' Use of this source code is governed by a Apache
|
|
' license that can be found in the LICENSE file.
|
|
|
|
@startuml
|
|
|
|
title int32 <=> *C.char
|
|
|
|
participant int32
|
|
participant uintptr
|
|
participant unsafe.Pointer as unsafe_Pointer
|
|
participant "~*C.char" as c_char_ptr
|
|
|
|
== Go ==
|
|
|
|
int32 -> uintptr: int32 to uintptr
|
|
uintptr -> unsafe_Pointer: uintptr to unsafe.Pointer
|
|
|
|
== CGO ==
|
|
|
|
unsafe_Pointer -> c_char_ptr: unsafe.Pointer to *C.char
|
|
c_char_ptr -> unsafe_Pointer: ~*C.char to unsafe.Pointer
|
|
|
|
== Go ==
|
|
|
|
unsafe_Pointer -> uintptr: unsafe.Pointer to uintptr
|
|
uintptr -> int32: uintptr to int32
|
|
|
|
@enduml
|