src/server/pkg/workload/workload.go
func (w *worker) putFile(c *client.APIClient) error {
	if len(w.started) == 0 {
		return nil
	}
	commit := w.started[w.rand.Intn(len(w.started))]
	if _, err := c.PutFile(commit.Repo.Name, commit.ID, w.randString(10), w.reader()); err != nil {
		return err
	}
	return nil
}
func (w *worker) putFile(c *client.APIClient) error {
	if len(w.started) == 0 {
		return nil
	}
	commit := w.started[w.rand.Intn(len(w.started))]
	if _, err := c.PutFile(commit.Repo.Name, commit.ID, w.randString(10), w.reader()); err != nil {
		return err
	}
	return nil
}
func ( w * worker ) putFile ( c * client . APIClient ) error { if len ( w . started ) == 0 { return nil } commit := w . started [ w . rand . Intn ( len ( w . started ) ) ] if _ , err := c . PutFile ( commit . Repo . Name , commit . ID , w . randString ( 10 ) , w . reader ( ) ) ; err != nil { return err } return nil }
// putFile puts a file with random contents into a random open commit (or exits
// early if there are none)
putFile puts a file with random contents into a random open commit ( or exits early if there are none )