feat(example): Add an example for how to use buildGo builders

This commit is contained in:
Vincent Ambo 2019-11-24 20:34:30 +00:00
parent d441e035aa
commit 071babf148
4 changed files with 84 additions and 0 deletions

22
example/main.go Normal file
View file

@ -0,0 +1,22 @@
// Copyright 2019 Google LLC.
// SPDX-License-Identifier: Apache-2.0
//
// Package main provides a tiny example program for the Bazel-style
// Nix build system for Go.
package main
import (
"example"
"exampleproto"
"fmt"
)
func main() {
thing := exampleproto.Thing{
Id: example.UUID(),
KindOfThing: "test thing",
}
fmt.Printf("The thing is a %s with ID %q\n", thing.Id, thing.KindOfThing)
}