AddBoard appends a fresh board with a unique grain seed and makes it active. Returns the new board.
(name string)
| 327 | // AddBoard appends a fresh board with a unique grain seed and makes it |
| 328 | // active. Returns the new board. |
| 329 | func (w *Workspace) AddBoard(name string) *Board { |
| 330 | if name == "" { |
| 331 | name = "board " + intToStr(len(w.Boards)+1) |
| 332 | } |
| 333 | b := &Board{ |
| 334 | Name: name, |
| 335 | GrainSeed: time.Now().UnixNano(), |
| 336 | } |
| 337 | w.Boards = append(w.Boards, b) |
| 338 | w.ActiveIdx = len(w.Boards) - 1 |
| 339 | return b |
| 340 | } |
| 341 | |
| 342 | // DeleteBoard removes the board at index i. Refuses to delete the last |
| 343 | // remaining board. |
no test coverage detected