protoc-gen-gotemplate icon indicating copy to clipboard operation
protoc-gen-gotemplate copied to clipboard

splitArray | last doesn't work in online demo

Open asad-awadia opened this issue 5 years ago • 1 comments

http://protoc-gen-gotemplate.m.42.am/

// here request.(*pb.{{.InputType | splitArray "." | last }}) doing this gives

2019/08/04 15:46:10 new encoder: file="example.proto" service="RouteGuide" template-dir="/tmp/pggt313081003"
2019/08/04 15:46:10 new template: "example.output.tmpl"
panic: template: example.output.tmpl:27:53: executing "example.output.tmpl" at <last>: wrong type for value; expected []interface {}; got []string

goroutine 1 [running]:
main.(*GenericTemplateBasedEncoder).Files(0xc420015a40, 0x12, 0xc42005dc00, 0xc420162000)
	/go/src/github.com/moul/protoc-gen-gotemplate/encoder.go:194 +0x4f1
main.main()
	/go/src/github.com/moul/protoc-gen-gotemplate/main.go:130 +0x3e0
--gotemplate_out: protoc-gen-gotemplate: Plugin failed with status code 2.

asad-awadia avatar Aug 04 '19 15:08 asad-awadia

@moul

asad-awadia avatar Aug 04 '19 15:08 asad-awadia