Skip to content

Commit 2b0485b

Browse files
committed
switch to suggested variable name during review
1 parent 2ec09a8 commit 2b0485b

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

pkg/kepval/keps/validations/yaml.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ func (m *MustHaveAtLeastOneValue) Error() string {
8686
return fmt.Sprintf("%q must have at least one value", m.key)
8787
}
8888

89-
var listSIGsAndWGs []string
89+
var listGroups []string
9090

9191
func init() {
9292
resp, err := http.Get("https://raw.githubusercontent.com/kubernetes/community/master/sigs.yaml")
@@ -101,14 +101,14 @@ func init() {
101101
for scanner.Scan() {
102102
match := re.FindStringSubmatch(scanner.Text())
103103
if len(match)>0 {
104-
listSIGsAndWGs = append(listSIGsAndWGs, match[1])
104+
listGroups = append(listGroups, match[1])
105105
}
106106
}
107107
if err := scanner.Err(); err != nil {
108108
fmt.Fprintf(os.Stderr, "unable to scan list of sigs: %v", err)
109109
os.Exit(1)
110110
}
111-
sort.Strings(listSIGsAndWGs)
111+
sort.Strings(listGroups)
112112
}
113113

114114
var mandatoryKeys = []string{"title", "owning-sig"}
@@ -147,9 +147,9 @@ func ValidateStructure(parsed map[interface{}]interface{}) error {
147147
return &ValueMustBeString{k, v}
148148
}
149149
v, _ := value.(string)
150-
index := sort.SearchStrings(listSIGsAndWGs, v)
151-
if index >= len(listSIGsAndWGs) || listSIGsAndWGs[index] != v {
152-
return &ValueMustBeOneOf{k, v, listSIGsAndWGs}
150+
index := sort.SearchStrings(listGroups, v)
151+
if index >= len(listGroups) || listGroups[index] != v {
152+
return &ValueMustBeOneOf{k, v, listGroups}
153153
}
154154
// optional strings
155155
case "editor":
@@ -193,9 +193,9 @@ func ValidateStructure(parsed map[interface{}]interface{}) error {
193193
if strings.ToLower(k) == "participating-sigs" {
194194
for _, value := range values {
195195
v := value.(string)
196-
index := sort.SearchStrings(listSIGsAndWGs, v)
197-
if index >= len(listSIGsAndWGs) || listSIGsAndWGs[index] != v {
198-
return &ValueMustBeOneOf{k, v, listSIGsAndWGs}
196+
index := sort.SearchStrings(listGroups, v)
197+
if index >= len(listGroups) || listGroups[index] != v {
198+
return &ValueMustBeOneOf{k, v, listGroups}
199199
}
200200
}
201201
}

0 commit comments

Comments
 (0)