diff --git a/examples/concat/Makefile b/examples/concat/Makefile new file mode 100644 index 0000000..60bc04f --- /dev/null +++ b/examples/concat/Makefile @@ -0,0 +1,13 @@ +.PHONY: build +build: + mkdir -p output + protoc -I. --gotemplate_out=template_dir=templates,debug=true,all=true:output proto/*.proto + + +.PHONY: re +re: clean build + + +.PHONY: clean +clean: + rm -rf output diff --git a/examples/concat/output/concat.txt b/examples/concat/output/concat.txt new file mode 100644 index 0000000..83e9930 --- /dev/null +++ b/examples/concat/output/concat.txt @@ -0,0 +1,3 @@ +I'm Eric +I'm Francis +I'm Arnold diff --git a/examples/concat/output/static.txt b/examples/concat/output/static.txt new file mode 100644 index 0000000..410455f --- /dev/null +++ b/examples/concat/output/static.txt @@ -0,0 +1 @@ +This is static text.This is static text.This is static text. \ No newline at end of file diff --git a/examples/concat/proto/Eric.proto b/examples/concat/proto/Eric.proto new file mode 100644 index 0000000..ce20a4b --- /dev/null +++ b/examples/concat/proto/Eric.proto @@ -0,0 +1,2 @@ +syntax = "proto3"; +package Eric; diff --git a/examples/concat/proto/Francis.proto b/examples/concat/proto/Francis.proto new file mode 100644 index 0000000..c381e5c --- /dev/null +++ b/examples/concat/proto/Francis.proto @@ -0,0 +1,2 @@ +syntax = "proto3"; +package Francis; diff --git a/examples/concat/proto/arnold.proto b/examples/concat/proto/arnold.proto new file mode 100644 index 0000000..f284210 --- /dev/null +++ b/examples/concat/proto/arnold.proto @@ -0,0 +1,2 @@ +syntax = "proto3"; +package Arnold; diff --git a/examples/concat/templates/concat.txt.tmpl b/examples/concat/templates/concat.txt.tmpl new file mode 100644 index 0000000..308309e --- /dev/null +++ b/examples/concat/templates/concat.txt.tmpl @@ -0,0 +1 @@ +I'm {{.File.Package}} diff --git a/examples/concat/templates/static.txt.tmpl b/examples/concat/templates/static.txt.tmpl new file mode 100644 index 0000000..82165d2 --- /dev/null +++ b/examples/concat/templates/static.txt.tmpl @@ -0,0 +1 @@ +This is static text. \ No newline at end of file