// Remove removes tracking the storage config from iid.
Remove removes tracking the storage config from iid.
// Remove removes tracking the storage config from iid .
func (s *Store) Remove(iid ffs.APIID, c cid.Cid) error {
	scs, err := s.get(c)
	if err != nil {
		return fmt.Errorf("getting current storage configs for cid: %s", err)
	}
	idx := -1
	for i := range scs {
		if scs[i].IID == iid {
			idx = i
			break
		}
	}
	if idx != -1 {
		scs[idx] = scs[len(scs)-1]
		scs = scs[:len(scs)-1]
	}
	if err := s.persist(c, scs); err != nil {
		return fmt.Errorf("persisting updated storage configs for cid: %s", err)
	}
	return nil
}
func ( s * Store ) Remove ( iid ffs . APIID , c cid . Cid ) error { scs , err := s . get ( c ) if err != nil { return fmt . Errorf ( " " , err ) } idx := - 1 for i := range scs { if scs [ i ] . IID == iid { idx = i break } } if idx != - 1 { scs [ idx ] = scs [ len ( scs ) - 1 ] scs = scs [ : len ( scs ) - 1 ] } if err := s . persist ( c , scs ) ; err != nil { return fmt . Errorf ( " " , err ) } return nil }
Remove removes tracking the storage config from iid.
Remove removes tracking the storage config from iid .