// Homework 27, challenge: Dog and friend. // // Build a dog struct with a name field and a friend field of type *dog. A nil // friend means that the dog has no friend. Write: // newDog(name) -- a function that returns a *dog with no friend // describe() -- prints " has no friend." or // " is friends with ." // // Make two dogs and call describe on both. Then make one the friend of the // other, and describe both again. Finally, change the friend's name through // the friend field, and describe both once more. // // Run with: go run exercises/27/homework/04-dog-friend.go package main import "fmt" // TODO: define the dog struct, newDog and describe here, outside main. func main() { // TODO: write your code here, in place of this placeholder line: fmt.Println("TODO: replace this line") }