保存的方法值会输出什么?
Go
package main
import "fmt"
type Price struct{ Cents int }
func (price Price) WithTax(tax int) int {
return price.Cents + tax
}
func main() {
price := Price{Cents: 100}
calculate := price.WithTax
price.Cents = 200
fmt.Println(calculate(20))
}