@@ -369,20 +369,20 @@ func resourceGitlabGroupUpdate(ctx context.Context, d *schema.ResourceData, meta
369
369
}
370
370
371
371
if d .HasChange ("parent_id" ) {
372
- diagnostic : = transferSubGroup (ctx , d , client )
373
- if diagnostic . HasError () {
374
- return diagnostic
372
+ err = transferSubGroup (ctx , d , client )
373
+ if err != nil {
374
+ return diag . FromErr ( err )
375
375
}
376
376
}
377
377
378
378
return resourceGitlabGroupRead (ctx , d , meta )
379
379
}
380
380
381
- func transferSubGroup (ctx context.Context , d * schema.ResourceData , client * gitlab.Client ) diag. Diagnostics {
381
+ func transferSubGroup (ctx context.Context , d * schema.ResourceData , client * gitlab.Client ) error {
382
382
o , n := d .GetChange ("parent_id" )
383
383
parentId , ok := n .(int )
384
384
if ! ok {
385
- return diag .Errorf ("error converting parent_id %v into an int" , n )
385
+ return fmt .Errorf ("error converting parent_id %v into an int" , n )
386
386
}
387
387
388
388
opt := & gitlab.TransferSubGroupOptions {}
@@ -395,7 +395,7 @@ func transferSubGroup(ctx context.Context, d *schema.ResourceData, client *gitla
395
395
396
396
_ , _ , err := client .Groups .TransferSubGroup (d .Id (), opt , gitlab .WithContext (ctx ))
397
397
if err != nil {
398
- return diag .Errorf ("error transfering group %s to new parent group %v: %s" , d .Id (), parentId , err )
398
+ return fmt .Errorf ("error transfering group %s to new parent group %v: %s" , d .Id (), parentId , err )
399
399
}
400
400
401
401
return nil
0 commit comments