type fakeKeyring … // Lookup implements the DockerKeyring method for fetching credentials based on image name. // Returns fake results based on the auth and ok fields in fakeKeyring func (f *fakeKeyring) Lookup(image string) ([]credentialprovider.AuthConfig, bool) { … } func Test_MakeDockerKeyring(t *testing.T) { … }