@@ -26,14 +26,14 @@ type Resolved struct {
2626 // map from $ids to their schemas
2727 resolvedURIs map [string ]* Schema
2828 // map from schemas to additional info computed during resolution
29- resolvedInfo map [* Schema ]* resolvedInfo
29+ resolvedInfos map [* Schema ]* resolvedInfo
3030}
3131
3232func newResolved (s * Schema ) * Resolved {
3333 return & Resolved {
34- root : s ,
35- resolvedURIs : map [string ]* Schema {},
36- resolvedInfo : map [* Schema ]* resolvedInfo {},
34+ root : s ,
35+ resolvedURIs : map [string ]* Schema {},
36+ resolvedInfos : map [* Schema ]* resolvedInfo {},
3737 }
3838}
3939
@@ -89,7 +89,7 @@ func (r *Resolved) schemaString(s *Schema) string {
8989 if s .ID != "" {
9090 return s .ID
9191 }
92- info := r .resolvedInfo [s ]
92+ info := r .resolvedInfos [s ]
9393 if info .path != "" {
9494 return info .path
9595 }
@@ -187,7 +187,7 @@ func (r *resolver) resolve(s *Schema, baseURI *url.URL) (*Resolved, error) {
187187 }
188188 rs := newResolved (s )
189189
190- if err := s .check (rs .resolvedInfo ); err != nil {
190+ if err := s .check (rs .resolvedInfos ); err != nil {
191191 return nil , err
192192 }
193193
@@ -199,7 +199,7 @@ func (r *resolver) resolve(s *Schema, baseURI *url.URL) (*Resolved, error) {
199199 // which may differ if the schema has an $id.
200200 // We must set the map before calling resolveRefs, or ref cycles will cause unbounded recursion.
201201 r .loaded [baseURI .String ()] = rs
202- r .loaded [rs .resolvedInfo [s ].uri .String ()] = rs
202+ r .loaded [rs .resolvedInfos [s ].uri .String ()] = rs
203203
204204 if err := r .resolveRefs (rs ); err != nil {
205205 return nil , err
@@ -385,8 +385,8 @@ func (s *Schema) checkLocal(report func(error), infos map[*Schema]*resolvedInfo)
385385func resolveURIs (rs * Resolved , baseURI * url.URL ) error {
386386 var resolve func (s , base * Schema ) error
387387 resolve = func (s , base * Schema ) error {
388- info := rs .resolvedInfo [s ]
389- baseInfo := rs .resolvedInfo [base ]
388+ info := rs .resolvedInfos [s ]
389+ baseInfo := rs .resolvedInfos [base ]
390390
391391 // ids are scoped to the root.
392392 if s .ID != "" {
@@ -405,7 +405,7 @@ func resolveURIs(rs *Resolved, baseURI *url.URL) error {
405405 }
406406 rs .resolvedURIs [info .uri .String ()] = s
407407 base = s // needed for anchors
408- baseInfo = rs .resolvedInfo [base ]
408+ baseInfo = rs .resolvedInfos [base ]
409409 }
410410 info .base = base
411411
@@ -436,7 +436,7 @@ func resolveURIs(rs *Resolved, baseURI *url.URL) error {
436436 }
437437
438438 // Set the root URI to the base for now. If the root has an $id, this will change.
439- rs .resolvedInfo [rs .root ].uri = baseURI
439+ rs .resolvedInfos [rs .root ].uri = baseURI
440440 // The original base, even if changed, is still a valid way to refer to the root.
441441 rs .resolvedURIs [baseURI .String ()] = rs .root
442442
@@ -448,7 +448,7 @@ func resolveURIs(rs *Resolved, baseURI *url.URL) error {
448448// that needs to be loaded.
449449func (r * resolver ) resolveRefs (rs * Resolved ) error {
450450 for s := range rs .root .all () {
451- info := rs .resolvedInfo [s ]
451+ info := rs .resolvedInfos [s ]
452452 if s .Ref != "" {
453453 refSchema , _ , err := r .resolveRef (rs , s , s .Ref )
454454 if err != nil {
@@ -484,8 +484,8 @@ func (r *resolver) resolveRef(rs *Resolved, s *Schema, ref string) (_ *Schema, d
484484 return nil , "" , err
485485 }
486486 // URI-resolve the ref against the current base URI to get a complete URI.
487- base := rs .resolvedInfo [s ].base
488- refURI = rs .resolvedInfo [base ].uri .ResolveReference (refURI )
487+ base := rs .resolvedInfos [s ].base
488+ refURI = rs .resolvedInfos [base ].uri .ResolveReference (refURI )
489489 // The non-fragment part of a ref URI refers to the base URI of some schema.
490490 // This part is the same for dynamic refs too: their non-fragment part resolves
491491 // lexically.
@@ -517,9 +517,9 @@ func (r *resolver) resolveRef(rs *Resolved, s *Schema, ref string) (_ *Schema, d
517517 assert (referencedSchema != nil , "nil referenced schema" )
518518 // Copy the resolvedInfos from lrs into rs, without overwriting
519519 // (hence we can't use maps.Insert).
520- for s , i := range lrs .resolvedInfo {
521- if rs .resolvedInfo [s ] == nil {
522- rs .resolvedInfo [s ] = i
520+ for s , i := range lrs .resolvedInfos {
521+ if rs .resolvedInfos [s ] == nil {
522+ rs .resolvedInfos [s ] = i
523523 }
524524 }
525525 }
@@ -531,7 +531,7 @@ func (r *resolver) resolveRef(rs *Resolved, s *Schema, ref string) (_ *Schema, d
531531 // A JSON Pointer is either the empty string or begins with a '/',
532532 // whereas anchors are always non-empty strings that don't contain slashes.
533533 if frag != "" && ! strings .HasPrefix (frag , "/" ) {
534- resInfo := rs .resolvedInfo [referencedSchema ]
534+ resInfo := rs .resolvedInfos [referencedSchema ]
535535 info , found := resInfo .anchors [frag ]
536536
537537 if ! found {
0 commit comments