Skip to content

Commit

Permalink
Use apparent repo name in go mod tidy suggestion
Browse files Browse the repository at this point in the history
This will print `@io_bazel_rules_go//go:go` if the user uses the legacy repo name. Before Bazel 8.1.0, it will emit `...//go:go` instead of `...//go`, but correctness is more important than brevity in this case.
  • Loading branch information
fmeum committed Jan 7, 2025
1 parent 23a2816 commit ea73ae8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/go_repository.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ def _go_repository_impl(ctx):
fail("cannot specify both version and %s" % key)
if not ctx.attr.sum:
if is_module_extension_repo:
fail("No sum for {}@{} found, run bazel run @rules_go//go -- mod tidy to generate it".format(ctx.attr.importpath, ctx.attr.version))
fail("No sum for {}@{} found, update go.sum with:\n bazel run".format(ctx.attr.importpath, ctx.attr.version), Label("@io_bazel_rules_go//go"), "-- mod tidy")
else:
fail("if version is specified, sum must also be")

Expand Down

0 comments on commit ea73ae8

Please sign in to comment.