tree: 7d4e9b795b4f525f9cf58500238da9efdff1a595 [path history] [tgz]
  1. .bazelrc
  2. .bazelversion
  3. BUILD.bazel
  4. hello.go
  5. hello_test.go
  6. MODULE.bazel
  7. MODULE.bazel.lock
  8. README.md
examples/hello/README.md

rules_go “Hello World” example

This directory contains a minimal, standalone example using Bazel and rules_go. It shows how to use the go_binary, go_library, and go_test rules without requiring any other dependencies.

To run the binary:

bazel run //:hello

To test the library:

bazel test //:hello_test

For an explanation and an introduction to Bazel, see Bazel Tutorial: Build a Go Project.