gen/api15gen/api_analyzer.go
func LocatorFunc(attributes []*gen.Attribute, name string) string {
	hasLinks := false
	for _, a := range attributes {
		if a.FieldName == "Links" {
			hasLinks = true
			break
		}
	}
	if !hasLinks {
		return ""
	}
	return `for _, l := range r.Links {
			if l["rel"] == "self" {
				return api.` + name + `Locator(l["href"])
			}
		}
		return nil`
}
func LocatorFunc(attributes []*gen.Attribute, name string) string {
	hasLinks := false
	for _, a := range attributes {
		if a.FieldName == "Links" {
			hasLinks = true
			break
		}
	}
	if !hasLinks {
		return ""
	}
	return `for _, l := range r.Links {
			if l["rel"] == "self" {
				return api.` + name + `Locator(l["href"])
			}
		}
		return nil`
}
// LocatorFunc returns the source code for building a locator instance from a resource.