Example #1
0
// Overwrite user-entered data (and timestamp) into the base complaint.
func Overwrite(this, from *types.Complaint) {
	orig := *this // Keep a temp copy
	*this = *from // Overwrite everything

	// Restore a few key fields from the original
	this.DatastoreKey = orig.DatastoreKey

	// If the orig had a description but new doesn't, don't lose it
	if this.Description == "" && orig.Description != "" {
		this.Description = orig.Description
	}
}