mirror of
https://github.com/unknwon/the-way-to-go_ZH_CN.git
synced 2025-08-12 03:06:41 +08:00
17 lines
250 B
Go
17 lines
250 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
)
|
|
|
|
// this function changes reply:
|
|
func Multiply(a, b int, reply *int) {
|
|
*reply = a * b
|
|
}
|
|
|
|
func main() {
|
|
n := 0
|
|
reply := &n
|
|
Multiply(10, 5, reply)
|
|
fmt.Println("Multiply:", *reply) // Multiply: 50
|
|
} |