package main
import "fmt"
func f(s *string) (string, string) {
*s = "def"
return "hello", *s
}
func main() {
s := "abc"
a, b := f(&s)
fmt.Println(a, b)
}
hello def
go 指针

package main
import "fmt"
func f(s *string) (string, string) {
*s = "def"
return "hello", *s
}
func main() {
s := "abc"
a, b := f(&s)
fmt.Println(a, b)
}
hello def