code: func PopulateReferences(domain string, types []*ProtoType) {
  	for _, protoType := range types {
  		ref := &GlobalReference{}
  		ref.LocalRefName = protoType.Id
  		if isBaseType(protoType) {
  			ref.IsBaseType = true
  			ref.BaseType = getGoType(protoType)
  		}
  
  		ref.ExternalGoName = domain + protoType.Id
  		// an array pointing to another type
  		if protoType.IsArray() {
  			arrType := protoType.GetArrayType()
  			ref.IsArrayRef = true
  			ref.ExternalGoName = domain + arrType
  			ref.RefToRefName = domain + "." + arrType
  		}
  
  		if len(protoType.Enum) > 0 {
  			ref.EnumDescription = " enum values: " + strings.Join(protoType.Enum, ", ")
  		}
  		globalRefs[domain+"."+protoType.Id] = ref
  
  		if ref.IsBaseType == false {
  			populateSubReferences(domain, protoType)
  		}
  	}
  }
docs: // Loops over the domain ProtoType slice to create a reference map that we can use
  // to resolve references when we go to spit out templates. We check if the type is a base
  // type like:
  // {
  //     "id": "RequestId",
  //     "type": "string",
  //     "description": "Unique request identifier."
  // },
  // Instead of spitting out "type NetworkRequestId string" and having other structs
  // include references to it, we resolve any references directly to 'string'
  // this makes working with the API far easier (no stupid type conversions everywhere)