// RefType returns the type name of a reference, suitable for looking up in
// s.Definitions.
170047
func RefType(s *spec.Schema) string {
	return strings.TrimPrefix(s.Ref.String(), "#/definitions/")
}
1182026
func Refs(c context.Context, a Authority, path string, r MultiResolver, meta *[]*config.Meta) error {
	return getAll(c, a, backend.GetAllRef, path, r, meta)
}
1296112
func (s *StructSpec) ForEachTypeReference(f func(TypeSpec) error) error {
	return s.Fields.ForEachTypeReference(f)
}
1102019
func typeName(item mo.Reference) string {
	return reflect.TypeOf(item).Elem().Name()
}
601287
func (d *DeleteEvent) GetRefType() string {
	if d == nil || d.RefType == nil {
		return ""
	}
	return *d.RefType
}
1001024
func (t RefType) Prefix() (string, bool) {
	switch t {
	case RefTypeLocalBranch:
		return "refs/heads", true
	case RefTypeRemoteBranch:
		return "refs/remotes", true
	case RefTypeLocalTag:
		return "refs/tags", true
	default:
		return "", false
	}
}
1189239
func (s *Store) AddRef() {
	s.m.Lock()
	s.refs++
	s.m.Unlock()
}
793426
func (r *Repository) Reference(name plumbing.ReferenceName, resolved bool) (
	*plumbing.Reference, error) {

	if resolved {
		return storer.ResolveReference(r.Storer, name)
	}

	return r.Storer.Reference(name)
}
691694
func ParseRefToTypeAndName(fullref string) (t RefType, name string) {
	const localPrefix = "refs/heads/"
	const remotePrefix = "refs/remotes/"
	const localTagPrefix = "refs/tags/"

	if fullref == "HEAD" {
		name = fullref
		t = RefTypeHEAD
	} else if strings.HasPrefix(fullref, localPrefix) {
		name = fullref[len(localPrefix):]
		t = RefTypeLocalBranch
	} else if strings.HasPrefix(fullref, remotePrefix) {
		name = fullref[len(remotePrefix):]
		t = RefTypeRemoteBranch
	} else if strings.HasPrefix(fullref, localTagPrefix) {
		name = fullref[len(localTagPrefix):]
		t = RefTypeLocalTag
	} else {
		name = fullref
		t = RefTypeOther
	}
	return
}
644003
func TypeRef(api *design.APIDefinition, ut *design.UserTypeDefinition) string {
	if _, ok := Definitions[ut.TypeName]; !ok {
		GenerateTypeDefinition(api, ut)
	}
	return fmt.Sprintf("#/definitions/%s", ut.TypeName)
}
436087
func formatRefName(ref *git.Ref, remote string) string {
	if ref.Type == git.RefTypeRemoteBranch {
		return strings.Join([]string{
			"refs", "remotes", remote, ref.Name}, "/")
	}
	return ref.Refspec()

}
1007628
func (c *Interface) Ref() error {
	var err C.virError
	ret := C.virInterfaceRefWrapper(c.ptr, &err)
	if ret == -1 {
		return makeError(&err)
	}
	return nil
}
943267
func (l *LargeFile) GetRefName() string {
	if l == nil || l.RefName == nil {
		return ""
	}
	return *l.RefName
}
1072459
func Type(tname string) reflect.Type {
	if t, found := typemap[tname]; found {
		return t
	}
	panic("Type not found: " + tname)
}
1069138
func (p BlockPointer) Ref() BlockRef {
	return BlockRef{
		ID:       p.ID,
		RefNonce: p.RefNonce,
	}
}
1088418
func (m *MockGitilesClient) Refs(ctx context.Context, in *RefsRequest, opts ...grpc.CallOption) (*RefsResponse, error) {
	varargs := []interface{}{ctx, in}
	for _, a := range opts {
		varargs = append(varargs, a)
	}
	ret := m.ctrl.Call(m, "Refs", varargs...)
	ret0, _ := ret[0].(*RefsResponse)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}
742522
func (t *TSMReader) Ref() {
	atomic.AddInt64(&t.refs, 1)
	t.refsWG.Add(1)
}