registry: remove intermediate vars in mock

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2023-09-08 14:22:21 +02:00
parent 550e628f05
commit 43740ab642
No known key found for this signature in database
GPG key ID: 76698F39D527CE8C

View file

@ -76,35 +76,30 @@ func makeHTTPSURL(req string) string {
}
func makeIndex(req string) *registry.IndexInfo {
index := &registry.IndexInfo{
return &registry.IndexInfo{
Name: makeURL(req),
}
return index
}
func makeHTTPSIndex(req string) *registry.IndexInfo {
index := &registry.IndexInfo{
return &registry.IndexInfo{
Name: makeHTTPSURL(req),
}
return index
}
func makePublicIndex() *registry.IndexInfo {
index := &registry.IndexInfo{
return &registry.IndexInfo{
Name: IndexServer,
Secure: true,
Official: true,
}
return index
}
func makeServiceConfig(mirrors []string, insecureRegistries []string) (*serviceConfig, error) {
options := ServiceOptions{
return newServiceConfig(ServiceOptions{
Mirrors: mirrors,
InsecureRegistries: insecureRegistries,
}
return newServiceConfig(options)
})
}
func writeHeaders(w http.ResponseWriter) {