@@ -158,12 +158,12 @@ func squashEntries(entries []*OasDiffEntry) ([]*OasDiffEntry, error) {
158158 }
159159 }
160160
161- squashedEntriesNotHidden , err := appplySquashHandlerToMap (squashHandlers , entriesByIDandOperationID )
161+ squashedEntriesNotHidden , err := applySquashHandlerToMap (squashHandlers , entriesByIDandOperationID )
162162 if err != nil {
163163 return nil , err
164164 }
165165
166- squashedEntriesHidden , err := appplySquashHandlerToMap (squashHandlers , hiddenEntriesByIDandOperationID )
166+ squashedEntriesHidden , err := applySquashHandlerToMap (squashHandlers , hiddenEntriesByIDandOperationID )
167167 if err != nil {
168168 return nil , err
169169 }
@@ -174,7 +174,7 @@ func squashEntries(entries []*OasDiffEntry) ([]*OasDiffEntry, error) {
174174 return squashedEntries , nil
175175}
176176
177- func appplySquashHandlerToMap (squashHandlers []handler , entriesMap map [string ]map [string ][]* OasDiffEntry ) ([]* OasDiffEntry , error ) {
177+ func applySquashHandlerToMap (squashHandlers []handler , entriesMap map [string ]map [string ][]* OasDiffEntry ) ([]* OasDiffEntry , error ) {
178178 squashedEntries := []* OasDiffEntry {}
179179 for _ , handler := range squashHandlers {
180180 entryMapPerOperationID , ok := entriesMap [handler .id ]
@@ -209,7 +209,7 @@ func findHandler(id string) (*handler, bool) {
209209 return nil , false
210210}
211211
212- type squashedEntries struct {
212+ type valuesToSquashStruct 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 ]squashedEntries , error ) {
307+ func newSquashMap (operation string , entries []* OasDiffEntry , expectedNumberOfValues , squashIdx int ) (map [string ]valuesToSquashStruct , 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 ]squashedEntries {}
313+ squashMap := map [string ]valuesToSquashStruct {}
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 ] = squashedEntries {
325+ squashMap [mergedKey ] = valuesToSquashStruct {
326326 valuesNotSquashed : values ,
327327 valuesToSquash : make (map [string ]struct {}),
328328 }
0 commit comments