Skip to content

Commit

Permalink
More if/return cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenwithav committed Oct 19, 2024
1 parent d28ad0e commit 618e211
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions pkg/runner/run_context.go
Original file line number Diff line number Diff line change
Expand Up @@ -990,13 +990,18 @@ func nestedMapLookup(m map[string]interface{}, ks ...string) (rval interface{})
}
if rval, ok = m[ks[0]]; !ok {
return nil
} else if len(ks) == 1 { // we've reached the final key
}

if len(ks) == 1 { // we've reached the final key
return rval
} else if m, ok = rval.(map[string]interface{}); !ok {
}

if m, ok = rval.(map[string]interface{}); !ok {
return nil
} else { // 1+ more keys
return nestedMapLookup(m, ks[1:]...)
}

// 1+ more keys
return nestedMapLookup(m, ks[1:]...)
}

func (rc *RunContext) withGithubEnv(ctx context.Context, github *model.GithubContext, env map[string]string) map[string]string {
Expand Down

0 comments on commit 618e211

Please sign in to comment.