Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // What will be the output?
- type Person struct {
- Name string
- Age int
- }
- func modifyPerson(p Person) {
- p.Age = 30
- }
- func main() {
- person := Person{Name: "Alice", Age: 25}
- modifyPerson(person)
- fmt.Println(person)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement