This commit is contained in:
Manfred Touron 2016-11-05 21:08:41 +01:00
parent 1773f1b44d
commit b934f53b41
No known key found for this signature in database
GPG Key ID: 9CCF47DF1FD978A1
4 changed files with 40 additions and 0 deletions

2
.gitignore vendored
View File

@ -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

View File

@ -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
View File

@ -0,0 +1,4 @@
.PHONY: build
build:
mkdir -p output
protoc -I. --gotemplate_out=output *.proto

32
test/dummy.proto Normal file
View 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 {
}
*/