Skip to content

Commit

Permalink
Add comment on inferProvider call
Browse files Browse the repository at this point in the history
This is to clarify the expectations on this function.

Signed-off-by: Juan Antonio Osorio <[email protected]>
  • Loading branch information
JAORMX committed Mar 27, 2024
1 parent f18a5b3 commit 791030f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/controlplane/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,9 @@ func getNameFilterParam(in *pb.Context) sql.NullString {
}
}

// given a list of providers, inferProvider will validate the filter and
// return the provider if it can be inferred. Note that this assumes that validation
// has already been made and that the list of providers is not empty.
func inferProvider(providers []db.Provider, nameFilter sql.NullString) (db.Provider, error) {
if !nameFilter.Valid {
if len(providers) == 1 {
Expand Down

0 comments on commit 791030f

Please sign in to comment.