// Id is uuid value. // model is a pointer. func (s Xorm) UuidSave(model interface{}) (int64, error) { logger.Trace("UuidSave modell") if mmodel.GetModelId(model) == "" { mmodel.AddModelUuid(model) } n, err := s.Engine.Insert(model) logger.CheckError(err) return n, err }
func Demo(m1 interface{}) { fmt.Println(mmodel.GetModelId(m1)) m2 := mmodel.AddModelUuid(m1) fmt.Printf("%+v\n", m1) fmt.Printf("%+v\n", m2) }