Skip to content

Commit

Permalink
Cannnot cover packages with no source files
Browse files Browse the repository at this point in the history
Summary:
As titled. Just return without any coverage.

#build_rule_type[go_library,go_binary,go_unittest,go_test]

Reviewed By: podtserkovskiy

Differential Revision: D68783589

fbshipit-source-id: 380ed6fae3377f5edfe0ad4286648df2e4f1ec05
  • Loading branch information
echistyakov authored and facebook-github-bot committed Jan 28, 2025
1 parent e111249 commit 5a87c1d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions prelude/go/package_builder.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,9 @@ def _cover(ctx: AnalysisContext, pkg_name: str, pkg_import_path: str, go_files:
if coverage_mode == None:
return go_files, "", None

if len(go_files) == 0:
return go_files, "", None

go_toolchain = ctx.attrs._go_toolchain[GoToolchainInfo]
env = get_toolchain_env_vars(go_toolchain)

Expand Down

0 comments on commit 5a87c1d

Please sign in to comment.