generate nil safe library code
iamneal opened this issue · 0 comments
iamneal commented
protoc-gen-persist generates functions similar to this:
func AuthorToLibraryPersistType(req *Author) (*persist_lib.AuthorForLibrary, error) {
params := &persist_lib.AuthorForLibrary{}
params.Id = req.Id
params.FirstName = req.FirstName
params.LastName = req.LastName
return params, nil
}
This is not safe if req
is nil.