Security
- The generated function
Register<Service>Server
now panics if theUnimplemented<Service>Server
struct is embedded in a way that would otherwise lead to runtime panics if an unimplemented method was called. Users are advised to ensure they are properly embedding theUnimplemented
struct for their service, and to regenerate their proto files to confirm. (#7438)- Note: "Proper embedding" of the
Unimplemented
struct means either embedding the struct by value (preferred) or ensuring it is always initialized to a valid pointer. E.g.
- Note: "Proper embedding" of the
struct MyServiceImpl {
pb.UnimplementedMyServiceServer // embedded by value, not pointer
// .. other struct fields ..
}
New Features
- Generated code for services will produce streaming method definitions using one of six different generic types (e.g.
BidiStreamingServer
orClientStreamingClient
) instead of producing complete interfaces and implementations for the streaming methods. This can be disabled by settinguse_generic_streams_experimental=false
. Please file a bug if you encounter any issues with this behavior. (#7387)
Bug Fixes
- A period (.) is added to the end of the service interface doc comment to comply with Godoc. (#7392)