Skip to content

Commit

Permalink
修复 unsafe.Offsetof 的描述错误
Browse files Browse the repository at this point in the history
  • Loading branch information
eddycjy committed Jan 6, 2019
1 parent 35808f8 commit 0139c11
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ n.i: 煎鱼, n.j: 2
type uintptr uintptr
```

2、unsafe.Offsetof:返回变量的字节大小,也就是本文用到的偏移量大小。需要注意的是入参 `ArbitraryType` 表示任意类型,并非定义的 `int`。它实际作用是一个占位符
2、unsafe.Offsetof:返回成员变量 x 在结构体当中的偏移量。更具体的讲,就是返回结构体初始位置到 x 之间的字节数。需要注意的是入参 `ArbitraryType` 表示任意类型,并非定义的 `int`。它实际作用是一个占位符

```
func Offsetof(x ArbitraryType) uintptr
Expand Down

0 comments on commit 0139c11

Please sign in to comment.