1
0
mirror of https://github.com/chai2010/advanced-go-programming-book.git synced 2025-05-24 04:22:22 +00:00

Merge pull request #141 from fuwensun/pr3-23

ch3-04-fix typo
This commit is contained in:
chai2010 2018-06-28 20:26:02 +08:00 committed by GitHub
commit 01a0149d4e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -85,7 +85,7 @@ func SomeFunc(a, b int, c bool) (d float64, err error)
函数的参数有不同的类型,同时含有多个返回值,而且返回值中含有更复杂的接口类型。我们该如何计算每个参数的位置和总的大小呢?
其实函数参数和返回值的大小以及对齐问题和结构体的大小和成员对齐问题是一致的。我们先看看如用Go语言函数来模拟Foo函数中参数和返回值的地址
其实函数参数和返回值的大小以及对齐问题和结构体的大小和成员对齐问题是一致的。我们先看看如用Go语言函数来模拟Foo函数中参数和返回值的地址
```go
func Foo(FP *struct{a, b, c int}) {