mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-24 22:43:05 +00:00
annotations: Give better names to local variabes in search functions
Use more meaningful variable names for clarity. Fixes: #901 Suggested-by: James O.D. Hunt james.o.hunt@intel.com> Signed-off-by: Christophe de Dinechin <dinechin@redhat.com>
This commit is contained in:
parent
b5db114aad
commit
b119427405
@ -183,18 +183,18 @@ func containerMounts(spec specs.Spec) []vc.Mount {
|
||||
return mnts
|
||||
}
|
||||
|
||||
func contains(s []string, e string) bool {
|
||||
for _, a := range s {
|
||||
if a == e {
|
||||
func contains(strings []string, toFind string) bool {
|
||||
for _, candidate := range strings {
|
||||
if candidate == toFind {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func regexpContains(s []string, e string) bool {
|
||||
for _, a := range s {
|
||||
if matched, _ := regexp.MatchString(a, e); matched {
|
||||
func regexpContains(regexps []string, toMatch string) bool {
|
||||
for _, candidate := range regexps {
|
||||
if matched, _ := regexp.MatchString(candidate, toMatch); matched {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user