code: func (s *ResourceState) prune() {
  	s.Lock()
  	defer s.Unlock()
  
  	n := len(s.Deposed)
  	for i := 0; i < n; i++ {
  		inst := s.Deposed[i]
  		if inst == nil || inst.ID == "" {
  			copy(s.Deposed[i:], s.Deposed[i+1:])
  			s.Deposed[n-1] = nil
  			n--
  			i--
  		}
  	}
  	s.Deposed = s.Deposed[:n]
  
  	s.Dependencies = uniqueStrings(s.Dependencies)
  }
docs: // prune is used to remove any instances that are no longer required