Skip to content

Commit

Permalink
docs: Mention that gazelle:prefix can be replaced by go.mod
Browse files Browse the repository at this point in the history
  • Loading branch information
fmeum committed Jun 1, 2023
1 parent b8d560e commit 30a5e5c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions docs/go/core/bzlmod.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,19 @@ If you have a use case that would require this, please explain it in an issue.

## Generating BUILD files

Add the following to your top-level BUILD file, including your Go module's path in a [Gazelle directive](https://github.com/bazelbuild/bazel-gazelle#directives):
Add the following to your top-level BUILD file:

```starlark
load("@gazelle//:def.bzl", "gazelle")

# gazelle:prefix github.com/example/project
gazelle(name = "gazelle")
```

If there is no `go.mod` file in the same directory as your top-level BUILD file, also add the following [Gazelle directive](https://github.com/bazelbuild/bazel-gazelle#directives) to that BUILD file to supply Gazelle with your Go module's path:
```
# gazelle:prefix github.com/example/project
```

Then, use `bazel run //:gazelle` to (re-)generate BUILD files.

## External dependencies
Expand Down

0 comments on commit 30a5e5c

Please sign in to comment.