Sobes.tech
Senior

pacote principal import "fmt" tipo Pessoa struct { Nome string } func alterarNome(pessoa *Pessoa) { pessoa = &Pessoa{ Nome: "Alice", } } func main() { pessoa := &Pessoa{ Nome: "Bob", } fmt.Println(pessoa.Nome) // alterarNome(pessoa) fmt.Println(pessoa.Nome) // }