File tree 5 files changed +33
-0
lines changed
5 files changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -50,3 +50,5 @@ pip.parse(
50
50
requirements_lock = "//examples/lang_toolchains:requirements.txt" ,
51
51
)
52
52
use_repo (pip , "pypi" )
53
+
54
+ bazel_dep (name = "rules_go" , version = "0.48.0" )
Original file line number Diff line number Diff line change 1
1
load ("@rules_proto//proto:defs.bzl" , "proto_library" )
2
2
load ("@rules_python//python:proto.bzl" , "py_proto_library" )
3
+ load ("@rules_go//proto:def.bzl" , "go_proto_library" )
3
4
4
5
package (default_visibility = ["//visibility:public" ])
5
6
@@ -18,3 +19,9 @@ java_proto_library(
18
19
name = "foo_java_proto" ,
19
20
deps = [":foo_proto" ],
20
21
)
22
+
23
+ go_proto_library (
24
+ name = "foo_go_proto" ,
25
+ importpath = "example.com/foo_proto" ,
26
+ proto = ":foo_proto" ,
27
+ )
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ syntax = "proto3";
2
2
3
3
import "google/protobuf/any.proto" ;
4
4
5
+ option go_package = "example.com/foo_proto" ;
5
6
option java_package = "proto" ;
6
7
7
8
message Foo {
Original file line number Diff line number Diff line change
1
+ load ("@rules_go//go:def.bzl" , "go_test" )
2
+
3
+ go_test (
4
+ name = "foo_proto_test" ,
5
+ srcs = ["foo_proto_test.go" ],
6
+ deps = ["//examples:foo_go_proto" ],
7
+ )
Original file line number Diff line number Diff line change
1
+ package proto_test
2
+
3
+ import (
4
+ "testing"
5
+
6
+ "example.com/foo_proto"
7
+ )
8
+
9
+ func TestFoo (t * testing.T ) {
10
+ msg := & foo_proto.Foo {
11
+ Msg : "hello world" ,
12
+ }
13
+ if msg .Msg != "hello world" {
14
+ t .Fail ()
15
+ }
16
+ }
You can’t perform that action at this time.
0 commit comments