Finished refactor of story/chapter/comment related stuff.
the build was successful

This commit is contained in:
2019-08-25 16:10:10 +02:00
parent 8c4670580c
commit 2eed815993
22 changed files with 737 additions and 502 deletions
+6 -2
View File
@@ -27,8 +27,12 @@ type Change struct {
// AddObject adds the model into the appropriate array.
func (change *Change) AddObject(object interface{}) bool {
if v := reflect.ValueOf(object); v.Kind() != reflect.Ptr && v.Kind() != reflect.Slice {
return change.AddObject(v.Addr().Interface())
if v := reflect.ValueOf(object); v.Kind() == reflect.Struct {
ptr := reflect.PtrTo(v.Type())
ptrValue := reflect.New(ptr.Elem())
ptrValue.Elem().Set(v)
object = ptrValue.Interface()
}
switch object := object.(type) {