@@ -147,13 +147,13 @@ func squashEntries(entries []*OasDiffEntry) ([]*OasDiffEntry, error) {
147147 entriesByIDandOperationID , hiddenEntriesByIDandOperationID := newEntriesMapPerIDAndOperationID (entries )
148148
149149 squashHandlers := newSquashHandlers ()
150- squashedEntries := []* OasDiffEntry {}
150+ squashedEntriesOut := []* OasDiffEntry {}
151151
152152 for _ , entry := range entries {
153153 // if no squash handlers implemented for entry's code,
154154 // just append the entry to the result
155155 if _ , ok := findHandler (entry .ID ); ! ok {
156- squashedEntries = append (squashedEntries , entry )
156+ squashedEntriesOut = append (squashedEntriesOut , entry )
157157 continue
158158 }
159159 }
@@ -168,14 +168,14 @@ func squashEntries(entries []*OasDiffEntry) ([]*OasDiffEntry, error) {
168168 return nil , err
169169 }
170170
171- squashedEntries = append (squashedEntries , squashedEntriesNotHidden ... )
172- squashedEntries = append (squashedEntries , squashedEntriesHidden ... )
171+ squashedEntriesOut = append (squashedEntriesOut , squashedEntriesNotHidden ... )
172+ squashedEntriesOut = append (squashedEntriesOut , squashedEntriesHidden ... )
173173
174- return squashedEntries , nil
174+ return squashedEntriesOut , nil
175175}
176176
177177func applySquashHandlerToMap (squashHandlers []handler , entriesMap map [string ]map [string ][]* OasDiffEntry ) ([]* OasDiffEntry , error ) {
178- squashedEntries := []* OasDiffEntry {}
178+ squashedEntriesOut := []* OasDiffEntry {}
179179 for _ , handler := range squashHandlers {
180180 entryMapPerOperationID , ok := entriesMap [handler .id ]
181181 if ! ok {
@@ -187,9 +187,9 @@ func applySquashHandlerToMap(squashHandlers []handler, entriesMap map[string]map
187187 return nil , err
188188 }
189189
190- squashedEntries = append (squashedEntries , sortEntriesByDescription (entries )... )
190+ squashedEntriesOut = append (squashedEntriesOut , sortEntriesByDescription (entries )... )
191191 }
192- return squashedEntries , nil
192+ return squashedEntriesOut , nil
193193}
194194
195195func sortEntriesByDescription (entries []* OasDiffEntry ) []* OasDiffEntry {
@@ -209,7 +209,7 @@ func findHandler(id string) (*handler, bool) {
209209 return nil , false
210210}
211211
212- type valuesToSquashStruct struct {
212+ type squashedEntries struct {
213213 valuesNotSquashed []string
214214 valuesToSquash map [string ]struct {}
215215}
@@ -304,13 +304,13 @@ func replaceOnlyFirstOccurrence(template, valuesToAddToTemplate string) string {
304304 })
305305}
306306
307- func newSquashMap (operation string , entries []* OasDiffEntry , expectedNumberOfValues , squashIdx int ) (map [string ]valuesToSquashStruct , error ) {
307+ func newSquashMap (operation string , entries []* OasDiffEntry , expectedNumberOfValues , squashIdx int ) (map [string ]squashedEntries , error ) {
308308 // squash_map is a dictionary where:
309309 // The key is a string generated by concatenating values extracted from each entry, excluding the one at squash_idx (the index to be squashed).
310310 // The value is a tuple:
311311 // - The first element is a list of the values that are not squashed. Example: [regionName, 200]
312312 // - The second element is a set of values that should be squashed. Example: ("GLOBAL_EVENT_ADMIN", "ORG_MEMBER")
313- squashMap := map [string ]valuesToSquashStruct {}
313+ squashMap := map [string ]squashedEntries {}
314314
315315 for _ , entry := range entries {
316316 values , err := extractExactValuesOrFail (operation , entry , expectedNumberOfValues )
@@ -322,7 +322,7 @@ func newSquashMap(operation string, entries []*OasDiffEntry, expectedNumberOfVal
322322
323323 mergedKey := strings .Join (values , "|" )
324324 if _ , exists := squashMap [mergedKey ]; ! exists {
325- squashMap [mergedKey ] = valuesToSquashStruct {
325+ squashMap [mergedKey ] = squashedEntries {
326326 valuesNotSquashed : values ,
327327 valuesToSquash : make (map [string ]struct {}),
328328 }
0 commit comments