Created
May 24, 2017 03:31
-
-
Save theepicsnail/2ee5da7711d74a043fe5e6436e7df245 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
load("@io_bazel_rules_go//go:def.bzl", "go_prefix") | |
go_prefix("myThing") # No idea what this string should be. Probably matters *shrug* | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_prefix") | |
go_prefix("myThing") # again no idea. I don't really know go well enough. | |
go_binary( | |
name = "bin", | |
srcs = [ | |
"main.go" | |
] | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "fmt" | |
func main() { | |
fmt.Printf("Hello, world.\n") | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Note filenames use '_' instead of '/' because github won't let me put "myThing/BUILD" or "myThing/main.go" | |
snail@snailbox:~/go_bazel$ find . | |
. | |
./myThing | |
./myThing/BUILD | |
./myThing/main.go | |
./WORKSPACE | |
./BUILD | |
snail@snailbox:~/go_bazel$ bazel run //myThing:bin | |
INFO: Found 1 target... | |
Target //myThing:bin up-to-date: | |
bazel-bin/myThing/bin.a | |
bazel-bin/myThing/bin | |
INFO: Elapsed time: 4.390s, Critical Path: 0.96s | |
INFO: Running command line: bazel-bin/myThing/bin | |
Hello, world. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git_repository( | |
name = "io_bazel_rules_go", | |
remote = "https://github.com/bazelbuild/rules_go.git", | |
tag = "0.4.4", | |
) | |
load("@io_bazel_rules_go//go:def.bzl", "go_repositories") | |
go_repositories() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment