internal/extsvc/github: Simplify cachedGetRepository and its usage
Created by: indradhanush
I was pairing with @mollylogue last week which is when the nocache
falg tripped us up a little.
As the name suggests, the method checks the cache before making an API
request. As a result it shouldn't really be accepting another
flag (nocache
) to circumvent that process. A consumer can directly
use getRepositoryFromAPI
if that was the requirement.
Additionally, the only place this method is used at the moment is in
the GitHub V3Client.GetRepository and the value of nocache
is set to
false
. As a result this is unreachable code and removing the
argument from the method's signature is a safe change.
Finally, in this commit we also remove the inline closure from
the invocation of cachedGetRepository
and make it explicit to
improve readability.