// Wipe removes all Dataset objects from the Databook.
196541
func (d *Databook) Wipe() {
	for k := range d.sheets {
		delete(d.sheets, k)
	}
}
445199
func (g *Generator) Cleanup() {
	if len(g.genfiles) == 0 {
		return
	}
	os.RemoveAll(g.OutDir)
	g.genfiles = nil
}
764294
func (d *DiskStorer) Clean() {
	t := time.Now().UTC()

	files, err := ioutil.ReadDir(d.folderPath)

	if err != nil {
		panic(err)
	}

	for _, file := range files {
		tspec := times.Get(file)

		// File is expired
		if tspec.AccessTime().UTC().UTC().Add(d.maxAge).Before(t) {
			filePath := path.Join(d.folderPath, file.Name())

			d.mut.Lock()
			_, err := os.Stat(filePath)
			// If the file has been deleted manually from the server
			// in between the time we read the directory and now, it will
			// fail here with a ErrNotExist. If so, continue gracefully.
			// It would be innefficient to hold a lock for the duration of
			// the loop, so we only lock when we find an expired file.
			if os.IsNotExist(err) {
				d.mut.Unlock()
				continue
			} else if err != nil {
				panic(err)
			}

			err = os.Remove(filePath)
			d.mut.Unlock()
			if err != nil {
				panic(err)
			}
		}
	}
}
1054622
func (s *OrderedSet) Clear() {
	s.s = make([]string, 0)
	s.m = make(map[string]int, 0)
}
457640
func (s *StepTeardownInstance) Cleanup(state multistep.StateBag) {
	config := state.Get("config").(*Config)
	driver := state.Get("driver").(Driver)
	ui := state.Get("ui").(packer.Ui)

	ui.Say("Deleting disk...")
	errCh, err := driver.DeleteDisk(config.Zone, config.DiskName)
	if err == nil {
		select {
		case err = <-errCh:
		case <-time.After(config.stateTimeout):
			err = errors.New("time out while waiting for disk to delete")
		}
	}

	if err != nil {
		ui.Error(fmt.Sprintf(
			"Error deleting disk. Please delete it manually.\n\n"+
				"DiskName: %s\n"+
				"Zone: %s\n"+
				"Error: %s", config.DiskName, config.Zone, err))
	}

	ui.Message("Disk has been deleted!")

	return
}
574981
func (c *InputModal) Clear() {
	c.title = ""
	c.text = ""
	c.input.SetValue("")
	c.isDone = false
	c.isVisible = false
}
203818
func (d *DB) Wipe() error {
	return d.Update(func(tx *bbolt.Tx) error {
		err := tx.DeleteBucket(openChannelBucket)
		if err != nil && err != bbolt.ErrBucketNotFound {
			return err
		}

		err = tx.DeleteBucket(closedChannelBucket)
		if err != nil && err != bbolt.ErrBucketNotFound {
			return err
		}

		err = tx.DeleteBucket(invoiceBucket)
		if err != nil && err != bbolt.ErrBucketNotFound {
			return err
		}

		err = tx.DeleteBucket(nodeInfoBucket)
		if err != nil && err != bbolt.ErrBucketNotFound {
			return err
		}

		err = tx.DeleteBucket(nodeBucket)
		if err != nil && err != bbolt.ErrBucketNotFound {
			return err
		}
		err = tx.DeleteBucket(edgeBucket)
		if err != nil && err != bbolt.ErrBucketNotFound {
			return err
		}
		err = tx.DeleteBucket(edgeIndexBucket)
		if err != nil && err != bbolt.ErrBucketNotFound {
			return err
		}
		err = tx.DeleteBucket(graphMetaBucket)
		if err != nil && err != bbolt.ErrBucketNotFound {
			return err
		}

		return nil
	})
}
877669
func (s *StepAttachParallelsTools) Cleanup(state multistep.StateBag) {
	if s.cdromDevice == "" {
		return
	}

	driver := state.Get("driver").(Driver)
	ui := state.Get("ui").(packer.Ui)
	vmName := state.Get("vmName").(string)

	log.Println("Detaching Parallels Tools ISO...")

	command := []string{
		"set", vmName,
		"--device-del", s.cdromDevice,
	}

	if err := driver.Prlctl(command...); err != nil {
		ui.Error(fmt.Sprintf("Error detaching Parallels Tools ISO: %s", err))
	}
}
219236
func (r *Render) clear(cursor int) {
	r.move(cursor, 0)
	r.out.EraseDown()
}
1367630
func (c *InMemoryCache) Clear() {
	c.mu.Lock()
	c.items = map[string]Thunk{}
	c.mu.Unlock()
}
601219
func (c *user) erase() error {
	if err := c.usersCache.DeleteAllUsers(); err != nil {
		if !trace.IsNotFound(err) {
			return trace.Wrap(err)
		}
	}
	return nil
}
272934
func (t *Tree) clean(values []interface{}) []interface{} {
	result := values[:0]

	for _, v := range values {
		if contains(result, v) {
			continue
		}

		result = append(result, v)
	}

	return result
}
820256
func wipe(path string, suffixlist []string, excludes []string) {
	log.Printf("INFO: wiping '%s'\n", path)
	if f, err := os.Stat(path); err == nil {
		if f.IsDir() {
			if infos, err := ioutil.ReadDir(path); err != nil {
				log.Printf("WARN: unable to wipe '%s': %s\n", path, err)
			} else {
				for _, info := range infos {
					if !endsIn(info.Name(), suffixlist) && !in(info.Name(), excludes) {
						log.Printf("INFO: removing: '%s'\n", path+"/"+info.Name())
						if err := os.RemoveAll(path + "/" + info.Name()); err != nil {
							log.Printf("ERROR: unable to remove '%s': %s\n", path+"/"+info.Name(), err)
						}
					}
				}
			}
		} else {
			if err := os.Remove(path); err != nil {
				log.Printf("ERROR: unable to remove '%s': %s\n", path, err)
			}
		}
	} else {
		log.Printf("ERROR: unable to stat file: '%s': %s\n", path, err)
	}
}
1241973
func (rw *Response) Clean() error {
	if rw.body == nil {
		return nil
	}

	return rw.body.Clean()
}
1086287
func (s *State) clear() {
	*s = State{Inputs: s.Inputs, vars: s.vars}
	s.vars.ClearValues()
}
692965
func (file *DataFile) Clear() (err error) {
	if err = file.Close(); err != nil {
		return
	} else if err = os.Truncate(file.Path, 0); err != nil {
		return
	} else if file.Fh, err = os.OpenFile(file.Path, os.O_CREATE|os.O_RDWR, 0600); err != nil {
		return
	} else if err = file.overwriteWithZero(0, file.Growth); err != nil {
		return
	} else if file.Buf, err = gommap.Map(file.Fh); err != nil {
		return
	}
	file.Used, file.Size = 0, file.Growth
	tdlog.Infof("%s cleared: %d of %d bytes in-use", file.Path, file.Used, file.Size)
	return
}
769653
func (this *RedisStore) Clear() error {
	vals, err := this.getSessionKeys()
	if err != nil {
		return err
	}
	if len(vals) > 0 {
		this.conn.Send("MULTI")
		for _, v := range vals {
			this.conn.Send("DEL", v)
		}
		_, err = this.conn.Do("EXEC")
		if err != nil {
			return err
		}
	}
	return nil
}