Record adds a command to the recorder.
(cmd string)
| 25 | |
| 26 | // Record adds a command to the recorder. |
| 27 | func (r *commandRecorder) Record(cmd string) { |
| 28 | cmd = strings.ToLower(cmd) |
| 29 | r.mu.Lock() |
| 30 | defer r.mu.Unlock() |
| 31 | |
| 32 | r.commands = append(r.commands, cmd) |
| 33 | if len(r.commands) > r.maxSize { |
| 34 | r.commands = r.commands[1:] |
| 35 | } |
| 36 | } |
| 37 | |
| 38 | // LastCommands returns a copy of the recorded commands. |
| 39 | func (r *commandRecorder) LastCommands() []string { |
no outgoing calls
no test coverage detected