Skip to content

Commit 2668ba7

Browse files
committed
Simplify resolveNotify
Signed-off-by: Timo Sand <[email protected]>
1 parent e304bb3 commit 2668ba7

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

github/resource_github_team_settings.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -320,19 +320,19 @@ func resolveTeamIDs(ctx context.Context, meta *Owner, idOrSlug string) (string,
320320
// only one source can be active at a time.
321321
func resolveNotify(ctx context.Context, d *schema.ResourceData) bool {
322322
// Check if top-level notify is explicitly configured.
323-
if v, ok := d.GetOk("notify"); ok {
323+
if v := d.Get("notify").(bool); v {
324324
tflog.Debug(ctx, "Top-level notify is explicitly configured", map[string]any{
325325
"notify": v,
326326
})
327-
return v.(bool)
327+
return v
328328
}
329329

330330
// Fall back to deprecated nested field
331-
if v, ok := d.GetOk("review_request_delegation.0.notify"); ok {
331+
if v := d.Get("review_request_delegation.0.notify").(bool); v {
332332
tflog.Debug(ctx, "Deprecated nested notify is explicitly configured", map[string]any{
333333
"notify": v,
334334
})
335-
return v.(bool)
335+
return v
336336
}
337337

338338
return false

0 commit comments

Comments
 (0)