-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Open
Labels
type: cleanupAn internal cleanup or hygiene concern.An internal cleanup or hygiene concern.
Description
Client
All GAPIC clients.
Environment
All environments
Impact
Generated service registration function signatures will change from concrete types to an interfaces. Note that there will be no impact on most usages because the previous concrete type and generated service code both already implemented the interface.
However, customers that reference the modified code in one or more of the following four ways will be broken by an unmitigated change:
- Creating a variable with the generated function signature as the type for use in code, like so:
// Where *grpc.Server is being changed to grpc.ServiceRegistrar
var myRegisterFunc func(*grpc.Server, FooServer)
// call site that would break with change to RegisterFooServer
myRegisterFunc = foopb.RegisterFooServer
- Passing the function as a parameter typed as the function signature, like so:
// Where *grpc.Server is being changed to grpc.ServiceRegistrar
func myFunc(registerFunc func(*grpc.Server, FooServer)) { ... }
// call site that would break with change to RegisterFooServer
myFunc(foopb.RegisterFooServer)
- Making the function signature the type of a struct property, like so:
type MyFoo struct {
// Where *grpc.Server is being changed to grpc.ServiceRegistrar
RegisterFoo func(*grpc.Server, FooServer)
}
// call site that would break with change to RegisterFooServer
myFoo := MyFoo{
RegisterFoo: foopb.RegisterFooServer,
}
- Reflecting over the exported surface looking for a function with the old signature.
Metadata
Metadata
Assignees
Labels
type: cleanupAn internal cleanup or hygiene concern.An internal cleanup or hygiene concern.