package main import ( "fmt" "github.com/joyrexus/person" ) func main() { bill, _ := person.New("Bill") // sets defaults for Job, Age, Alive fmt.Printf("%#v\n", bill) // {Name:"Bill", Age:0, Job:"unknown", Alive:true} bob, _ := person.New("Bob", person.Job("programmer"), person.Age(44)) fmt.Printf("%#v\n", bob) // {Name:"Bob", Age:44, Job:"programmer", Alive:true} // change bob's configuration bob.Config(person.Age(33), person.Job("masseuse"), person.Alive(false)) fmt.Printf("%#v\n", bob) // {Name:"Bob", Age:33, Job:"masseuse", Alive:false} }