Skip to content

Commit

Permalink
CHeck for empty labels when trying to build a target
Browse files Browse the repository at this point in the history
Signed-off-by: Steeve Morin <[email protected]>
  • Loading branch information
steeve committed Aug 17, 2021
1 parent c64b2ce commit 651024f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion go/tools/gopackagesdriver/bazel_json_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,11 @@ func (b *BazelJSONBuilder) query(ctx context.Context, query string) ([]string, e
func (b *BazelJSONBuilder) Build(ctx context.Context, mode LoadMode) ([]string, error) {
labels, err := b.query(ctx, b.queryFromRequests(b.requests...))
if err != nil {
return nil, fmt.Errorf("unable to query: %w", err)
return nil, fmt.Errorf("query failed: %w", err)
}

if len(labels) == 0 {
return nil, fmt.Errorf("found no labels matching the requests")
}

buildArgs := concatStringsArrays([]string{
Expand Down

0 comments on commit 651024f

Please sign in to comment.