gogo / letmegrpc

[maintainer wanted] generates a web form gui from a grpc specification
BSD 3-Clause "New" or "Revised" License
421 stars 48 forks source link

Package name with dots in it causes failure #22

Closed utrack closed 7 years ago

utrack commented 8 years ago
» 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
utrack commented 8 years ago

Seems like it happens if package name has dots in it.

awalterschulze commented 8 years ago

Good to know. Interested in contributing a fix?

utrack commented 8 years ago

@awalterschulze Yeap, I'll look into it.

awalterschulze commented 8 years ago

That will be great thanks. Just be warned this is some of the worst code I have ever written. Unfortunately it works quite well.

ivucica commented 7 years ago

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.

awalterschulze commented 7 years ago

Its a bug that concerns the dot character

On Thu, 23 Feb 2017, 01:22 Ivan Vučica, notifications@github.com 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 https://github.com/gogo/letmegrpc/issues/22#issuecomment-281849697, or mute the thread https://github.com/notifications/unsubscribe-auth/ABvsLUKwPdnrAnFa2WOn44vgvYWpXtvwks5rfNFJgaJpZM4J1MLz .

ivucica commented 7 years ago

That much is obvious both from my report and this bug's title, no? 😂

awalterschulze commented 7 years ago

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 notifications@github.com 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 https://github.com/gogo/letmegrpc/issues/22#issuecomment-281946122, or mute the thread https://github.com/notifications/unsubscribe-auth/ABvsLS2_3f-vO5220iW1DvjncRXbGGdgks5rfVaOgaJpZM4J1MLz .

ivucica commented 7 years ago

Thanks! 😂

awalterschulze commented 7 years ago

Finally got some time. Fixed https://github.com/gogo/letmegrpc/commit/2d46be80c34f4f5e7dafb7db6be3880ccb3f4193