*Person
package main
type Person struct {
Name string
}
func convertRefTypeToType(refPerson *Person) Person {
// is it possible to convert *Person to Person
return Person{}
}
func main() {
personRef := &Person{Name: "Nick"}
person := convertRefTypeToType(personRef)
people := []Person{personRef} // person
}
But have error:
./refConvert.go:16: cannot use personRef (type *Person) as type Person in array element
*PersonPerson*Person