func apply(stamp, current int, count *int, hd *hood.Hood, info *Migrations, structVal reflect.Value, method reflect.Method) { log.Printf("applying %s...", method.Name) txn := hd.Begin() method.Func.Call([]reflect.Value{structVal, reflect.ValueOf(txn)}) info.Current = current txn.Save(info) err := txn.Commit() if err != nil { panic(err) } else { *count++ } }