mirror of
https://github.com/gopl-zh/gopl-zh.github.com.git
synced 2025-08-14 18:41:42 +00:00
@@ -50,7 +50,7 @@ func Bonus(e *Employee, percent int) int {
|
||||
}
|
||||
```
|
||||
|
||||
如果要在函數內部脩改結構體成員的話,用指針傳入是必鬚的;因爲在Go語言中,所有的函數參數都是值拷貝傳入的,函數參數將不再是函數調用時的原始變量。
|
||||
如果要在函數內部脩改結構體成員的話,用指針傳入是必須的;因爲在Go語言中,所有的函數參數都是值拷貝傳入的,函數參數將不再是函數調用時的原始變量。
|
||||
|
||||
```Go
|
||||
func AwardAnnualRaise(e *Employee) {
|
||||
|
Reference in New Issue
Block a user