Skip to content

Commit

Permalink
Document how to add Go dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
aherrmann committed Nov 25, 2021
1 parent 12db88e commit dd8e118
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions BAZEL-go.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Working with Go in Bazel

## Dependencies

Go dependencies are managed by [`go.mod`][go-deps] and [Gazelle][gazelle].
To add a new Go dependency

1. Run `go get` to add the dependency to `go.mod`. E.g.
```
go get github.com/envoyproxy/[email protected]
```
This should update `go.mod` and `go.sum`.
2. Run Gazelle to import the dependencies to Bazel.
```
bazel run //:gazelle-update-repos
```
This should update `go_deps.bzl`.
[go-deps]: https://go.dev/doc/modules/managing-dependencies
[gazelle]: https://github.com/bazelbuild/bazel-gazelle

0 comments on commit dd8e118

Please sign in to comment.