Protobuf-go uses "go_package" option and protoc arguments (-Mfile.proto=new_import;pck_name) to compile properties of package: physical import path and package name.
Currently csProto relies on import path only, but ignores package name. This PR fixes this issue.
Unfortunately, I didn't find unit tests for generator itself, so I didn't write tests either.
(Condition around imports added for cases when proto file doesn't contain any messages - for example, only list of enums. Currently it leads to uncompilable code - "imported but not used". I decided that it can be fit into one PR as I'm fixing imports.)
Protobuf-go uses "go_package" option and protoc arguments (-Mfile.proto=new_import;pck_name) to compile properties of package: physical import path and package name.
Currently csProto relies on import path only, but ignores package name. This PR fixes this issue.
Unfortunately, I didn't find unit tests for generator itself, so I didn't write tests either.
(Condition around imports added for cases when proto file doesn't contain any messages - for example, only list of enums. Currently it leads to uncompilable code - "imported but not used". I decided that it can be fit into one PR as I'm fixing imports.)
Fixes #121