package guestbook import ( "errors" "time" ) type Entry struct { ID int64 `json:"entry_id"` Created time.Time `json:"created"` Name string `json:"name"` Website string `json:"website,omitempty"` HideWebsite bool `json:"hide_website,omitempty"` Message string `json:"message"` Reply *Reply `json:"reply,omitempty"` } func NewEntry(name, message, website string, hideWebsite bool) (*Entry, error) { if name == "" || message == "" { return nil, errors.New("name and message field are required") } return &Entry{ Created: time.Now().UTC(), Name: name, Website: website, HideWebsite: hideWebsite, Message: message}, nil }