コード例 #1
0
ファイル: test1.go プロジェクト: txjmp/noteburt
func writeLoop(bookid, tabid string, noteids []string) {
	for i := 0; i < 10; i++ {
		note := new(d.Note)
		note.Id = noteids[rand.Intn(len(noteids))]
		note.Content = "changed Note " + note.Id
		note.When = time.Now()
		note.Html = true
		note.Mono = false
		noteParms := d.NoteParms{Bookid: bookid, Tabid: tabid, Note: note}
		resultChan := d.Data("changeNote", &noteParms)
		if result := <-resultChan; result.Status != d.DataOk {
			log.Fatal(result.Val.(string))
		}
	}
	doneChan <- "writeLoop done"
}