1
0
mirror of https://github.com/ManyakRus/crud_generator.git synced 2024-12-22 00:36:41 +02:00

сделал fmt.Errorf("Read()

This commit is contained in:
Nikitin Aleksandr 2024-02-02 12:54:12 +03:00
parent 8e96c88d70
commit 6690afbf63
2 changed files with 9 additions and 9 deletions

View File

@ -49,7 +49,7 @@ func (crud Crud_DB) Read_ctx(ctx context.Context, m *lawsuit_status_types.Lawsui
tx := db.First(m, id)
err = tx.Error
if err != nil {
err = fmt.Errorf("Read() id: %v, error: %v", m.id, err)
err = fmt.Errorf("Read() id: %v, error: %v", m.ID, err)
}
return err
@ -196,7 +196,7 @@ func (crud Crud_DB) create_update_ctx(ctx context.Context, m *lawsuit_status_typ
return err
}
if err != nil {
err = fmt.Errorf("Create_update() id: %v, error: %v", m.id, err)
err = fmt.Errorf("Create_update() id: %v, error: %v", m.ID, err)
}
return err
@ -235,7 +235,7 @@ func (crud Crud_DB) Delete_ctx(ctx context.Context, m *lawsuit_status_types.Laws
err = crud.Save_ctx(ctx, &m2)
if err != nil {
err = fmt.Errorf("Delete() id: %v, error: %v", m.id, err)
err = fmt.Errorf("Delete() id: %v, error: %v", m.ID, err)
}
return err
@ -274,7 +274,7 @@ func (crud Crud_DB) Restore_ctx(ctx context.Context, m *lawsuit_status_types.Law
err = crud.Save_ctx(ctx, &m2)
if err != nil {
err = fmt.Errorf("Restore() id: %v, error: %v", m.id, err)
err = fmt.Errorf("Restore() id: %v, error: %v", m.ID, err)
}
return err
@ -319,7 +319,7 @@ func (crud Crud_DB) Find_ByExtID_ctx(ctx context.Context, m *lawsuit_status_type
tx := db.Where("ext_id = ?", m.ExtID).Where("connection_id = ?", m.ConnectionID).First(m)
err = tx.Error
if err != nil {
err = fmt.Errorf("Find_ByExtID() id: %v, error: %v", m.id, err)
err = fmt.Errorf("Find_ByExtID() id: %v, error: %v", m.ID, err)
}
return err

View File

@ -196,7 +196,7 @@ func (crud Crud_DB) create_update_ctx(ctx context.Context, m *lawsuit_status_typ
return err
}
if err != nil {
err = fmt.Errorf("Create_Update() id: %v, error: %v", m.id, err)
err = fmt.Errorf("Create_Update() id: %v, error: %v", m.ID, err)
}
return err
@ -235,7 +235,7 @@ func (crud Crud_DB) Delete_ctx(ctx context.Context, m *lawsuit_status_types.Laws
err = crud.Save_ctx(ctx, &m2)
if err != nil {
err = fmt.Errorf("Delete() id: %v, error: %v", m.id, err)
err = fmt.Errorf("Delete() id: %v, error: %v", m.ID, err)
}
return err
@ -274,7 +274,7 @@ func (crud Crud_DB) Restore_ctx(ctx context.Context, m *lawsuit_status_types.Law
err = crud.Save_ctx(ctx, &m2)
if err != nil {
err = fmt.Errorf("Restore() id: %v, error: %v", m.id, err)
err = fmt.Errorf("Restore() id: %v, error: %v", m.ID, err)
}
return err
@ -319,7 +319,7 @@ func (crud Crud_DB) Find_ByExtID_ctx(ctx context.Context, m *lawsuit_status_type
tx := db.Where("ext_id = ?", m.ExtID).Where("connection_id = ?", m.ConnectionID).First(m)
err = tx.Error
if err != nil {
err = fmt.Errorf("Find_ByExtID() id: %v, error: %v", m.id, err)
err = fmt.Errorf("Find_ByExtID() id: %v, error: %v", m.ID, err)
}
return err