Package name with dots in it causes failure
utrack opened this issue · comments
Nikita Koptelov commented
» letmegrpc --addr=localhost:65021 --port=8080 -proto_path ~/go/src/content_api/domains/border/category ~/go/src/content_api/domains/border/category/category.proto
2016/09/05 19:03:53 panic: runtime error: index out of range
goroutine 1 [running]:
panic(0x55e280, 0xc42000a180)
/usr/lib/go/src/runtime/panic.go:500 +0x1a1
github.com/gogo/letmegrpc/html.(*html).generateFormFunc(0xc4200f3570, 0xc4200efd82, 0xe, 0xc4200134a0)
/home/u/go/src/github.com/gogo/letmegrpc/html/html.go:93 +0x4e1
github.com/gogo/letmegrpc/html.(*html).Generate(0xc4200f3570, 0xc4200da1b0)
/home/u/go/src/github.com/gogo/letmegrpc/html/html.go:169 +0x2dce
github.com/gogo/protobuf/protoc-gen-gogo/generator.(*Generator).generatePlugin(0xc42009e000, 0xc4200da1b0, 0x63c7e0, 0xc4200f3570)
/home/u/go/src/github.com/gogo/protobuf/protoc-gen-gogo/generator/helper.go:330 +0x142
github.com/gogo/protobuf/protoc-gen-gogo/generator.(*Generator).GeneratePlugin(0xc42009e000, 0x63c7e0, 0xc4200f3570)
/home/u/go/src/github.com/gogo/protobuf/protoc-gen-gogo/generator/helper.go:309 +0x22d
main.main()
/home/u/go/src/github.com/gogo/letmegrpc/protoc-gen-letmegrpc/main.go:59 +0x32e
--letmegrpc_out: protoc-gen-letmegrpc: Plugin failed with status code 2.
exit status 1
Nikita Koptelov commented
Seems like it happens if package name has dots in it.
Walter Schulze commented
Good to know.
Interested in contributing a fix?
Nikita Koptelov commented
@awalterschulze Yeap, I'll look into it.
Walter Schulze commented
That will be great thanks.
Just be warned this is some of the worst code I have ever written.
Unfortunately it works quite well.
Ivan Vučica commented
There is a different failure right now.
Assume this command:
protoc --letmegrpc_out=. -I. tmp.proto
Building this file works:
# tmp.proto
syntax = "proto3";
package com;
message Blah {
};
service Asd {
rpc Foo(Blah) returns (Blah);
}
Building this file does not:
# tmp.proto
syntax = "proto3";
package com.example;
message Blah {
};
service Asd {
rpc Foo(Blah) returns (Blah);
}
Error produced:
2017/02/23 00:21:24 protoc-gen-gogo: error:can't find object with type .com.example
--letmegrpc_out: protoc-gen-letmegrpc: Plugin failed with status code 1.
Error still talks about com.example
even if I change the package name to com.example.project
.
Walter Schulze commented
Its a bug that concerns the dot character
…On Thu, 23 Feb 2017, 01:22 Ivan Vučica, ***@***.***> wrote:
There is a different failure right now.
Assume this command:
protoc --letmegrpc_out=. -I. tmp.proto
Building this file works:
# tmp.proto
syntax = "proto3";package com;message Blah {
};service Asd {
rpc Foo(Blah) returns (Blah);
}
Building this file does not:
# tmp.proto
syntax = "proto3";package com.example;message Blah {
};service Asd {
rpc Foo(Blah) returns (Blah);
}
Error produced:
2017/02/23 00:21:24 protoc-gen-gogo: error:can't find object with type .com.example
--letmegrpc_out: protoc-gen-letmegrpc: Plugin failed with status code 1.
Error still talks about com.example even if I change the package name to
com.example.project.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#22 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ABvsLUKwPdnrAnFa2WOn44vgvYWpXtvwks5rfNFJgaJpZM4J1MLz>
.
Ivan Vučica commented
That much is obvious both from my report and this bug's title, no? 😂
Walter Schulze commented
Yes thats true :)
I'll look into this as soon as I get some time.
…On Thu, 23 Feb 2017 at 10:51 Ivan Vučica ***@***.***> wrote:
That much is obvious both from my report and this bug's title, no?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#22 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ABvsLS2_3f-vO5220iW1DvjncRXbGGdgks5rfVaOgaJpZM4J1MLz>
.
Ivan Vučica commented
Thanks! 😂
Walter Schulze commented
Finally got some time.
Fixed
2d46be8