Rename tempTrustShowOutput to entry

Now that it is the primary return value of a small function,
the long name only makes reading harder.

Should not change behavior.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
This commit is contained in:
Miloslav Trmač
2022-08-24 20:07:54 +02:00
parent 51064acc49
commit 1a97c4d9fa

View File

@ -85,8 +85,8 @@ func getPolicyShowOutput(policyContentStruct policyContent, systemRegistriesDirP
// descriptionsOfPolicyRequirements turns reqs into user-readable policy entries, with Transport/Name/Reponame coming from template, potentially looking up scope in registryConfigs. // descriptionsOfPolicyRequirements turns reqs into user-readable policy entries, with Transport/Name/Reponame coming from template, potentially looking up scope in registryConfigs.
func descriptionsOfPolicyRequirements(reqs []repoContent, template Policy, registryConfigs *registryConfiguration, scope string, idReader gpgIDReader) []*Policy { func descriptionsOfPolicyRequirements(reqs []repoContent, template Policy, registryConfigs *registryConfiguration, scope string, idReader gpgIDReader) []*Policy {
tempTrustShowOutput := template entry := template
tempTrustShowOutput.Type = trustTypeDescription(reqs[0].Type) entry.Type = trustTypeDescription(reqs[0].Type)
uids := []string{} uids := []string{}
for _, repoele := range reqs { for _, repoele := range reqs {
if len(repoele.KeyPath) > 0 { if len(repoele.KeyPath) > 0 {
@ -96,15 +96,15 @@ func descriptionsOfPolicyRequirements(reqs []repoContent, template Policy, regis
uids = append(uids, getGPGIdFromKeyData(idReader, repoele.KeyData)...) uids = append(uids, getGPGIdFromKeyData(idReader, repoele.KeyData)...)
} }
} }
tempTrustShowOutput.GPGId = strings.Join(uids, ", ") entry.GPGId = strings.Join(uids, ", ")
registryNamespace := haveMatchRegistry(scope, registryConfigs) registryNamespace := haveMatchRegistry(scope, registryConfigs)
if registryNamespace != nil { if registryNamespace != nil {
if registryNamespace.Lookaside != "" { if registryNamespace.Lookaside != "" {
tempTrustShowOutput.SignatureStore = registryNamespace.Lookaside entry.SignatureStore = registryNamespace.Lookaside
} else { // incl. registryNamespace.SigStore == "" } else { // incl. registryNamespace.SigStore == ""
tempTrustShowOutput.SignatureStore = registryNamespace.SigStore entry.SignatureStore = registryNamespace.SigStore
} }
} }
return []*Policy{&tempTrustShowOutput} return []*Policy{&entry}
} }