Replace instances of ResolveRepositories{} with with a nil return type where applicable
Created by: rvantonder
In #13164 I refactored functions that previously returned 5+ values, but now are set in a dedicated type resolveRepositories
. Because callers of those functions may or may not rely on those values to be initialized, the value of the dedicated type is always initialized to a non-nil value, even if an error occurs somewhere down the call chain. These initializations can be found by searching for return resolveRepositories{}, ...
.
Conventionally, a nil
value is returned in the return value if err
is non-nil. A further refactor can convert the type of the first return value to a pointer, so that the return statements become return nil, ...
to observe the convention. However, such a refactor must ensure that all callers check that the pointer return value is non-nil before performing any accesses, and must ensure that the changes preserve the original semantics of callers that rely on the zero values of the members in resolveRepositories
.