Skip to content

Commit

Permalink
Added go support and hello world example (#43)
Browse files Browse the repository at this point in the history
* Added go support (without gazelle) and hello world example

* Getting zip instead of tar.gz for bazel rules

* Added format to string

* Using toolchains 1.19.3

Co-authored-by: Jay Conrod <[email protected]>

* Inlining rules go version

Co-authored-by: Jay Conrod <[email protected]>
  • Loading branch information
anfelbar and jayconrod authored Nov 8, 2022
1 parent f12facd commit 15f621e
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 1 deletion.
18 changes: 17 additions & 1 deletion WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ load("@maven//:compat.bzl", "compat_repositories")

compat_repositories()


RULES_SCALA_VERSION = "20220201"

http_archive(
Expand All @@ -149,5 +148,22 @@ load("@io_bazel_rules_scala//scala:toolchains.bzl", "scala_register_toolchains")
scala_register_toolchains()

load("@io_bazel_rules_scala//testing:scalatest.bzl", "scalatest_repositories", "scalatest_toolchain")

scalatest_repositories()

scalatest_toolchain()

http_archive(
name = "io_bazel_rules_go",
sha256 = "099a9fb96a376ccbbb7d291ed4ecbdfd42f6bc822ab77ae6f1b5cb9e914e94fa",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.35.0/rules_go-v0.35.0.zip",
"https://github.com/bazelbuild/rules_go/releases/download/v0.35.0/rules_go-v0.35.0.zip",
],
)

load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")

go_rules_dependencies()

go_register_toolchains(version = "1.19.3")
9 changes: 9 additions & 0 deletions go/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
load("@io_bazel_rules_go//go:def.bzl", "go_binary")

go_binary(
name = "go",
srcs = glob([
"*.go",
]),
visibility = ["//visibility:public"],
)
7 changes: 7 additions & 0 deletions go/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package main

import "fmt"

func main() {
fmt.Println("hello world")
}

0 comments on commit 15f621e

Please sign in to comment.