Add test
This commit is contained in:
parent
1773f1b44d
commit
b934f53b41
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,3 +1,5 @@
|
|||||||
|
/test/output/
|
||||||
|
|
||||||
# Compiled Object files, Static and Dynamic libs (Shared Objects)
|
# Compiled Object files, Static and Dynamic libs (Shared Objects)
|
||||||
*.o
|
*.o
|
||||||
*.a
|
*.a
|
||||||
|
@ -19,6 +19,8 @@ func NewGenericTemplateBasedEncoder(service *descriptor.ServiceDescriptorProto,
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (e *GenericTemplateBasedEncoder) Files() []*plugin_go.CodeGeneratorResponse_File {
|
func (e *GenericTemplateBasedEncoder) Files() []*plugin_go.CodeGeneratorResponse_File {
|
||||||
|
//log.Printf("file: %v\n", e.file)
|
||||||
|
//log.Printf("service: %v\n", e.service)
|
||||||
var content string = "hello world"
|
var content string = "hello world"
|
||||||
var fileName string = "test.txt"
|
var fileName string = "test.txt"
|
||||||
return []*plugin_go.CodeGeneratorResponse_File{
|
return []*plugin_go.CodeGeneratorResponse_File{
|
||||||
|
4
test/Makefile
Normal file
4
test/Makefile
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
.PHONY: build
|
||||||
|
build:
|
||||||
|
mkdir -p output
|
||||||
|
protoc -I. --gotemplate_out=output *.proto
|
32
test/dummy.proto
Normal file
32
test/dummy.proto
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
syntax = "proto3";
|
||||||
|
|
||||||
|
package dummy;
|
||||||
|
|
||||||
|
message Dummy1 {
|
||||||
|
float aaa = 1;
|
||||||
|
string bbb = 2;
|
||||||
|
int32 ccc = 3;
|
||||||
|
int64 ddd = 4;
|
||||||
|
repeated string eee = 5;
|
||||||
|
}
|
||||||
|
|
||||||
|
message Dummy2 {
|
||||||
|
float fff = 1;
|
||||||
|
Dummy1 ggg = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
message Dummy3 {}
|
||||||
|
|
||||||
|
service DummyService {
|
||||||
|
rpc Hhh(Dummy1) returns (Dummy2) {}
|
||||||
|
rpc Iii(Dummy2) returns (Dummy1) {}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
service DummyService2 {
|
||||||
|
rpc Jjj(Dummy2) returns (Dummy2) {}
|
||||||
|
}
|
||||||
|
|
||||||
|
service DummyService3 {
|
||||||
|
}
|
||||||
|
*/
|
Loading…
Reference in New Issue
Block a user