// IsExist returns true if cached value exists.
323551
func (c *PostgresCacher) IsExist(key string) bool {
	var data []byte
	err := c.c.QueryRow("SELECT data FROM cache WHERE key=$1", c.md5(key)).Scan(&data)
	if err != nil && err != sql.ErrNoRows {
		panic("cache/postgres: error checking existence: " + err.Error())
	}
	return err != sql.ErrNoRows
}
168653
func (s Int64Slice) Exists(x int64) bool {
	i := s.Search(x)
	if i == len(s) {
		return false
	}

	return s[i] == x
}
1205666
func (r *GormWorkItemLinkRepository) CheckExists(ctx context.Context, id uuid.UUID) error {
	defer goa.MeasureSince([]string{"goa", "db", "workitemlink", "exists"}, time.Now())
	return repository.CheckExists(ctx, r.db, WorkItemLink{}.TableName(), id)
}
869102
func (s *FileStorage) SiteExists(domain string) (bool, error) {
	_, err := os.Stat(s.siteCertFile(domain))
	if os.IsNotExist(err) {
		return false, nil
	} else if err != nil {
		return false, err
	}

	_, err = os.Stat(s.siteKeyFile(domain))
	if err != nil {
		return false, err
	}
	return true, nil
}
1258229
func (arc *ConfigFactory) IsKeyExist(key string) bool {
	if arc.initSuccess == false {
		return false
	}

	return arc.configMgr.IsKeyExist(key)
}
1066365
func IsExist(fname string) bool {
	_, err := os.Stat(fname)

	return !os.IsNotExist(err)
}
1106453
func (c *MemoryCacher) IsExist(key string) bool {
	c.lock.RLock()
	defer c.lock.RUnlock()

	_, ok := c.items[key]
	return ok
}
1239536
func (d Data) FileExists(key string) bool {
	_, found := d.Files[key]
	return found
}
1315385
func (r *GormWorkItemTypeRepository) CheckExists(ctx context.Context, id uuid.UUID) error {
	defer goa.MeasureSince([]string{"goa", "db", "workitemtype", "exists"}, time.Now())
	log.Info(ctx, map[string]interface{}{
		"wit_id": id,
	}, "Checking if work item type exists")

	_, exists := cache.Get(id)
	if exists {
		return nil
	}
	return repository.CheckExists(ctx, r.db, WorkItemType{}.TableName(), id)
}
101655
func (s *Store) Exists(ctx context.Context, name string) bool {
	_, err := s.Get(ctx, name)
	return err == nil
}
1220851
func (d Data) KeyExists(key string) bool {
	_, found := d.Values[key]
	return found
}
672183
func (r *Redis) IsExist(key string) bool {
	conn := r.conn.Get()
	defer conn.Close()

	a, _ := conn.Do("EXISTS", key)
	i := a.(int64)
	if i > 0 {
		return true
	}
	return false
}
400507
func (r *Response) fileExists(file string) bool {
	if _, err := os.Stat(file); err == nil {
		return true
	}

	r.Status = http.StatusNotFound
	log.Warnf("cannot find %s file", file)
	return false
}
1362899
func IsExist(err error) bool {
	err = errors.Cause(err)
	if os.IsExist(err) {
		return true
	}
	switch pe := err.(type) {
	case nil:
		return false
	case *os.PathError:
		err = pe.Err
	case *os.LinkError:
		err = pe.Err
	case *os.SyscallError:
		err = pe.Err
	}
	return err == error_DIR_NOT_EMPTY
}
1359967
func (r *GormRepository) CheckExists(ctx context.Context, id uuid.UUID) error {
	return repository.CheckExists(ctx, r.db, SpaceTemplate{}.TableName(), id)
}
520188
func whereExist(entries interface{}, key string) (interface{}, error) {
	return generalizedWhere("whereExist", entries, key, func(value interface{}) bool {
		return value != nil
	})
}
145431
func (mem *Memcache) IsExist(key string) bool {
	if _, err := mem.conn.Get(key); err != nil {
		return false
	}
	return true
}