From 9d8e0ce5365bd90fae24c7854d900eac86ec2d62 Mon Sep 17 00:00:00 2001 From: Victor Nogueira Date: Tue, 11 Jul 2023 22:32:20 +0300 Subject: [PATCH] Handle errors, to solve errors pointed by gosec --- minio/resource_minio_iam_group.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/minio/resource_minio_iam_group.go b/minio/resource_minio_iam_group.go index e76c640b..fae4d92e 100644 --- a/minio/resource_minio_iam_group.go +++ b/minio/resource_minio_iam_group.go @@ -137,11 +137,8 @@ func minioReadGroup(ctx context.Context, d *schema.ResourceData, meta interface{ return NewResourceError("error reading IAM Group %s: %s", d.Id(), err) } - if output.Status == string(madmin.GroupDisabled) { - d.Set("disable_group", true) - } else { - d.Set("disable_group", false) - + if err := d.Set("disable_group", output.Status == string(madmin.GroupDisabled)); err != nil { + return NewResourceError("error reading IAM Group %s: %s", d.Id(), err) } return nil