kracekumar (2) [Avatar] Offline
#1
Chapter 2 contains Animal struct example . New() is bounded or created on Animal struct. The code in the book has syntax error. Here is the code snippet: http://play.golang.org/p/hEEMj1EB82 . Also Chapter 2 code snippets are missing in Github.
kracekumar (2) [Avatar] Offline
#2
Re: Chapter 2: New() *Animal has syntax mistake
Updated code: http://play.golang.org/p/OQTtnf6tBR but still same error.
Bill Kennedy (69) [Avatar] Offline
#3
Re: Chapter 2: New() *Animal has syntax mistake
This is the example:

package animal

// Animal represents all animals.
type Animal struct {
Name string
Age int
}

// New creates a value of the Animal type
func New() *Animal {
return new(Animal)
}

You are using type instead of func for the function.

Also, these are not full programming examples so we don't have code snippets.