/hello-bazel-go

Just a quick experiment using Bazel/Blaze to build a "Hello world" golang app.

Primary LanguagePythonApache License 2.0Apache-2.0

Bazel with Golang

  1. Clone this repo.

  2. Install Bazel.

Or, if you don't want to install Bazel locally, you can run it in a Docker container e.g.:

docker-compose run hello bash
  1. Generate the Bazel BUILD.bazel file(s) for any Go code using gazelle:
bazel run //:gazelle

Notice that this generates hello/BUILD.bazel.

Now we can run the Hello World Go code:

bazel run //hello